Исправил namespace, работает скачивание

This commit is contained in:
ujijrujijr 2024-05-29 12:43:21 +04:00
parent e1e37a6611
commit 686c98f1e8
23 changed files with 60 additions and 47 deletions

View File

@ -3,8 +3,8 @@ using ComputerShopContracts.BusinessLogicContracts;
using ComputerShopContracts.SearchModels;
using ComputerShopContracts.StorageContracts;
using ComputerShopContracts.ViewModels;
using GarmentFactoryBusinessLogic.OfficePackage;
using GarmentFactoryBusinessLogic.OfficePackage.HelperModels;
using ComputerShopBusinessLogic.OfficePackage;
using ComputerShopBusinessLogic.OfficePackage.HelperModels;
using System;
using System.Collections.Generic;
using System.Linq;
@ -55,7 +55,7 @@ namespace ComputerShopBusinessLogic.BusinessLogics
_saveToWord.CreateDoc(new WordInfoImplementer
{
FileName = model.FileName,
Title = "Список сборок по выбранным заявкам",
Title = "Список сборок по выбранным заказам",
OrderAssemblies = GetReportOrdersAssemblies(model.Ids)
});;
//throw new NotImplementedException();

View File

@ -1,12 +1,12 @@
using GarmentFactoryBusinessLogic.OfficePackage.HelperEnums;
using GarmentFactoryBusinessLogic.OfficePackage.HelperModels;
using ComputerShopBusinessLogic.OfficePackage.HelperEnums;
using ComputerShopBusinessLogic.OfficePackage.HelperModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage
namespace ComputerShopBusinessLogic.OfficePackage
{
public abstract class AbstractSaveToExcelImplementer
{
@ -143,7 +143,7 @@ namespace GarmentFactoryBusinessLogic.OfficePackage
}
}
rowIndex++;
//rowIndex++;
// foreach (var (Component, Count) in tc.Components)
// {

View File

@ -1,12 +1,12 @@
using GarmentFactoryBusinessLogic.OfficePackage.HelperEnums;
using GarmentFactoryBusinessLogic.OfficePackage.HelperModels;
using ComputerShopBusinessLogic.OfficePackage.HelperEnums;
using ComputerShopBusinessLogic.OfficePackage.HelperModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage
namespace ComputerShopBusinessLogic.OfficePackage
{
public abstract class AbstractSaveToPdfImplementer
{

View File

@ -1,12 +1,12 @@
using GarmentFactoryBusinessLogic.OfficePackage.HelperEnums;
using GarmentFactoryBusinessLogic.OfficePackage.HelperModels;
using ComputerShopBusinessLogic.OfficePackage.HelperEnums;
using ComputerShopBusinessLogic.OfficePackage.HelperModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage
namespace ComputerShopBusinessLogic.OfficePackage
{
public abstract class AbstractSaveToWordImplementer
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.HelperEnums
namespace ComputerShopBusinessLogic.OfficePackage.HelperEnums
{
public enum ExcelStyleInfoType
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.HelperEnums
namespace ComputerShopBusinessLogic.OfficePackage.HelperEnums
{
public enum PdfParagraphAlignmentType
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.HelperEnums
namespace ComputerShopBusinessLogic.OfficePackage.HelperEnums
{
public enum WordJustificationType
{

View File

@ -1,11 +1,11 @@
using GarmentFactoryBusinessLogic.OfficePackage.HelperEnums;
using ComputerShopBusinessLogic.OfficePackage.HelperEnums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.HelperModels
namespace ComputerShopBusinessLogic.OfficePackage.HelperModels
{
public class ExcelCellParameters
{

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.HelperModels
namespace ComputerShopBusinessLogic.OfficePackage.HelperModels
{
public class ExcelInfoImplementer
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.HelperModels
namespace ComputerShopBusinessLogic.OfficePackage.HelperModels
{
public class ExcelMergeParameters
{

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.HelperModels
namespace ComputerShopBusinessLogic.OfficePackage.HelperModels
{
public class PdfInfoImplementer
{

View File

@ -1,11 +1,11 @@
using GarmentFactoryBusinessLogic.OfficePackage.HelperEnums;
using ComputerShopBusinessLogic.OfficePackage.HelperEnums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.HelperModels
namespace ComputerShopBusinessLogic.OfficePackage.HelperModels
{
public class PdfParagraph
{

View File

@ -1,11 +1,11 @@
using GarmentFactoryBusinessLogic.OfficePackage.HelperEnums;
using ComputerShopBusinessLogic.OfficePackage.HelperEnums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.HelperModels
namespace ComputerShopBusinessLogic.OfficePackage.HelperModels
{
public class PdfRowParameters
{

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.HelperModels
namespace ComputerShopBusinessLogic.OfficePackage.HelperModels
{
public class WordInfoImplementer
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.HelperModels
namespace ComputerShopBusinessLogic.OfficePackage.HelperModels
{
public class WordParagraph
{

View File

@ -1,11 +1,11 @@
using GarmentFactoryBusinessLogic.OfficePackage.HelperEnums;
using ComputerShopBusinessLogic.OfficePackage.HelperEnums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.HelperModels
namespace ComputerShopBusinessLogic.OfficePackage.HelperModels
{
public class WordTextProperties
{

View File

@ -3,15 +3,15 @@ using DocumentFormat.OpenXml.Office2013.Excel;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
using DocumentFormat.OpenXml;
using GarmentFactoryBusinessLogic.OfficePackage.HelperEnums;
using GarmentFactoryBusinessLogic.OfficePackage.HelperModels;
using ComputerShopBusinessLogic.OfficePackage.HelperEnums;
using ComputerShopBusinessLogic.OfficePackage.HelperModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.Implements
namespace ComputerShopBusinessLogic.OfficePackage.Implements
{
public class SaveToExcelImplementer : AbstractSaveToExcelImplementer
{

View File

@ -1,5 +1,5 @@
using GarmentFactoryBusinessLogic.OfficePackage.HelperEnums;
using GarmentFactoryBusinessLogic.OfficePackage.HelperModels;
using ComputerShopBusinessLogic.OfficePackage.HelperEnums;
using ComputerShopBusinessLogic.OfficePackage.HelperModels;
using MigraDoc.DocumentObjectModel;
using MigraDoc.DocumentObjectModel.Tables;
using MigraDoc.Rendering;
@ -9,7 +9,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.Implements
namespace ComputerShopBusinessLogic.OfficePackage.Implements
{
public class SaveToPdfImplementer : AbstractSaveToPdfImplementer
{

View File

@ -1,15 +1,15 @@
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using GarmentFactoryBusinessLogic.OfficePackage.HelperEnums;
using GarmentFactoryBusinessLogic.OfficePackage.HelperModels;
using ComputerShopBusinessLogic.OfficePackage.HelperEnums;
using ComputerShopBusinessLogic.OfficePackage.HelperModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GarmentFactoryBusinessLogic.OfficePackage.Implements
namespace ComputerShopBusinessLogic.OfficePackage.Implements
{
public class SaveToWordImplementer : AbstractSaveToWordImplementer
{

View File

@ -560,8 +560,19 @@ namespace ComputerShopImplementerApp.Controllers
return View();
}
[HttpGet]
public IActionResult GetWordFile()
{
return PhysicalFile("C:\\!КУРСОВАЯ\\Сборки по выбранным заказам.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Сборки по выбранным заказам.docx");
}
public IActionResult GetExcelFile()
{
return PhysicalFile("C:\\!КУРСОВАЯ\\Сборки по выбранным заказам.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Сборки по выбранным заказам.xlsx");
}
[HttpPost]
public void ReportOrdersAssembliesToFile(int[] orders, string type)
public IActionResult ReportOrdersAssembliesToFile(int[] orders, string type)
{
if (APIUser.User == null)
{
@ -583,7 +594,8 @@ namespace ComputerShopImplementerApp.Controllers
Ids = ids,
FileName = "C:\\!КУРСОВАЯ\\Сборки по выбранным заказам.docx"
});
Response.Redirect("Index");
return GetWordFile();
//Response.Redirect("GetWordFile");
}
if (type == "xlsx")
@ -593,10 +605,11 @@ namespace ComputerShopImplementerApp.Controllers
Ids = ids,
FileName = "C:\\!КУРСОВАЯ\\Сборки по выбранным заказам.xlsx"
});
Response.Redirect("Index");
return GetExcelFile();
//Response.Redirect("GetExcelFile");
}
}
Response.Redirect("Index");
return Redirect("Index");
}

View File

@ -5,8 +5,8 @@ using ComputerShopDatabaseImplement.Implements;
using ComputerShopDatabaseImplement.Models;
using ComputerShopDataModels.Models;
using ComputerShopImplementerApp;
using GarmentFactoryBusinessLogic.OfficePackage;
using GarmentFactoryBusinessLogic.OfficePackage.Implements;
using ComputerShopBusinessLogic.OfficePackage;
using ComputerShopBusinessLogic.OfficePackage.Implements;
var builder = WebApplication.CreateBuilder(args);

View File

@ -13,7 +13,7 @@
@* !!!ЕСЛИ НЕ БУДЕТ РАБОТАТЬ, УБРАТЬ ОТСЮДА @order.Sum *@
@foreach (var order in ViewBag.Orders)
{
<option value="@order.Id">@order.DateCreate; @order.Sum</option>
<option value="@order.Id">@order.Id) @order.DateCreate; @order.Sum</option>
}
</select>
</div>

View File

@ -5,8 +5,8 @@ using ComputerShopDatabaseImplement.Implements;
using ComputerShopBusinessLogic.MailWorker;
using ComputerShopDatabaseImplement.Models;
using ComputerShopDataModels.Models;
using GarmentFactoryBusinessLogic.OfficePackage;
using GarmentFactoryBusinessLogic.OfficePackage.Implements;
using ComputerShopBusinessLogic.OfficePackage;
using ComputerShopBusinessLogic.OfficePackage.Implements;
using Microsoft.OpenApi.Models;
using ComputerShopContracts.BindingModels;