done
This commit is contained in:
parent
71de67e722
commit
d71a022960
@ -1,17 +1,13 @@
|
|||||||
/*using System;
|
using UniversityContracts.BindingModels;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using UniversityContracts.BindingModels;
|
|
||||||
using UniversityContracts.BusinessLogicContracts;
|
using UniversityContracts.BusinessLogicContracts;
|
||||||
using UniversityContracts.ViewModels;
|
using UniversityContracts.ViewModels;
|
||||||
using UniversityContracts.SearchModels;
|
using UniversityContracts.SearchModels;
|
||||||
using UniversityContracts.StoragesContracts;
|
using UniversityContracts.StoragesContracts;
|
||||||
using UniversityBusinessLogic.OfficePackage;
|
using UniversityBusinessLogic.OfficePackage;
|
||||||
using System.Reflection;
|
using System.Reflection.PortableExecutable;
|
||||||
using System.Net;
|
using DocumentFormat.OpenXml.InkML;
|
||||||
using System.Reflection.Metadata;
|
using DocumentFormat.OpenXml.Wordprocessing;
|
||||||
|
using UniversityBusinessLogic.BusinessLogic.OfficePackage;
|
||||||
|
|
||||||
namespace UniversityBusinessLogic.BusinessLogics
|
namespace UniversityBusinessLogic.BusinessLogics
|
||||||
{
|
{
|
||||||
@ -23,9 +19,10 @@ namespace UniversityBusinessLogic.BusinessLogics
|
|||||||
private readonly IEducationGroupStorage _educationGroupStorage;
|
private readonly IEducationGroupStorage _educationGroupStorage;
|
||||||
private readonly IDisciplineStorage _disciplineStorage;
|
private readonly IDisciplineStorage _disciplineStorage;
|
||||||
private readonly IStreamStorage _streamStorage;
|
private readonly IStreamStorage _streamStorage;
|
||||||
private readonly AbstractSaveToExcelProvider _saveToExcel;
|
private readonly WordBuilderCustomer _wordBuilder;
|
||||||
private readonly AbstractSaveToWordProvider _saveToWord;
|
private readonly ExcelBuilderCustomer _excelBuilder;
|
||||||
private readonly AbstractSaveToPdfProvider _saveToPdf;
|
private readonly PdfBuilderProvider _pdfBuilder;
|
||||||
|
private readonly MailSender _mailSender;
|
||||||
|
|
||||||
public ReportCustomerLogic(IDocumentStorage documentStorage,
|
public ReportCustomerLogic(IDocumentStorage documentStorage,
|
||||||
IStudentStorage studentStorage,
|
IStudentStorage studentStorage,
|
||||||
@ -33,9 +30,10 @@ namespace UniversityBusinessLogic.BusinessLogics
|
|||||||
IEducationGroupStorage educationGroupStorage,
|
IEducationGroupStorage educationGroupStorage,
|
||||||
IDisciplineStorage disciplineStorage,
|
IDisciplineStorage disciplineStorage,
|
||||||
IStreamStorage streamStorage,
|
IStreamStorage streamStorage,
|
||||||
AbstractSaveToExcelProvider saveToExcel,
|
WordBuilderCustomer wordBuilder,
|
||||||
AbstractSaveToWordProvider saveToWord,
|
ExcelBuilderCustomer excelBuilder,
|
||||||
AbstractSaveToPdfProvider saveToPdf)
|
PdfBuilderProvider pdfBuilder,
|
||||||
|
MailSender mailSender)
|
||||||
{
|
{
|
||||||
_documentStorage = documentStorage;
|
_documentStorage = documentStorage;
|
||||||
_studentStorage = studentStorage;
|
_studentStorage = studentStorage;
|
||||||
@ -43,69 +41,88 @@ namespace UniversityBusinessLogic.BusinessLogics
|
|||||||
_educationGroupStorage = educationGroupStorage;
|
_educationGroupStorage = educationGroupStorage;
|
||||||
_disciplineStorage = disciplineStorage;
|
_disciplineStorage = disciplineStorage;
|
||||||
_streamStorage = streamStorage;
|
_streamStorage = streamStorage;
|
||||||
_saveToExcel = saveToExcel;
|
_wordBuilder = wordBuilder;
|
||||||
_saveToWord = saveToWord;
|
_excelBuilder = excelBuilder;
|
||||||
_saveToPdf = saveToPdf;
|
_pdfBuilder = pdfBuilder;
|
||||||
|
_mailSender = mailSender;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ReportDisciplineViewModel> GetDiscipline(ReportBindingModel model)
|
public List<ReportStudentsDisciplineViewModel> GetStudentsDiscipline(List<StudentViewModel> students)
|
||||||
{
|
{
|
||||||
var result = _streamStorage.GetFilteredList(new StreamSearchModel { Id = _disciplineStorage.GetElement(new DisciplineSearchModel { Name = model.DisciplineName })?.StreamId })
|
var reportRecords = new List<ReportStudentsDisciplineViewModel>();
|
||||||
.Select(stream => new ReportDisciplineViewModel
|
foreach (var student in students)
|
||||||
{
|
{
|
||||||
DisciplineName = model.DisciplineName,
|
var disciplines = _studentStorage.GetStudentStreams(new() { Id = student.Id })
|
||||||
StudentEdStatus = stream.StudentStream
|
.SelectMany(stream => _streamStorage.GetStreamDisciplines(new() { Id = stream.Id }))
|
||||||
.Where(student => _documentStorage.GetFilteredList(new DocumentSearchModel
|
.Select(discipline => discipline.Name)
|
||||||
{
|
|
||||||
UserId = model.UserId,
|
|
||||||
DateFrom = model.DateFrom,
|
|
||||||
DateTo = model.DateTo,
|
|
||||||
})
|
|
||||||
.Any(document => document.DocumentStudents.Contains(student.Value)))//Выбираем студентов, которые есть в приказах за выбранный промежуток времени
|
|
||||||
.Join(_documentStorage.GetFullList(),
|
|
||||||
t1 => t1.Value.Id,
|
|
||||||
t2 => t2.UserId,
|
|
||||||
(t1, t2) => new { student = t1, document = t2 })
|
|
||||||
.Select(res => (
|
|
||||||
StudentFIO: $"{res.student.Value.Name} {res.student.Value.Surname}",
|
|
||||||
Document: $"{res.document.Date}",
|
|
||||||
EdStatus: _educationStatusStorage.GetElement(new EducationStatusSearchModel { Id = res.student.Value.EducationStatusId })?.Name ?? "не удалось получить"))
|
|
||||||
.ToList()
|
|
||||||
})
|
|
||||||
.ToList();
|
.ToList();
|
||||||
return result;
|
ReportStudentsDisciplineViewModel reportRecord = new()
|
||||||
|
{
|
||||||
|
Student = student.Name + " " + student.Surname + ", " + student.StudentCard,
|
||||||
|
Disciplines = disciplines
|
||||||
|
};
|
||||||
|
reportRecords.Add(reportRecord);
|
||||||
}
|
}
|
||||||
public List<ReportStreamEducationStatusViewModel> StreamEducationStatus(List<StreamViewModel> streams)
|
return reportRecords;
|
||||||
{
|
|
||||||
var result = streams
|
|
||||||
.Select(stream => new ReportStreamEducationStatusViewModel
|
|
||||||
{
|
|
||||||
StreamName = stream.Name,
|
|
||||||
StudentEdStatus = stream.StudentStream
|
|
||||||
.Select(student => (
|
|
||||||
StudentFIO: $"{student.Value.Name} {student.Value.Surname}",
|
|
||||||
EdStatus: _educationStatusStorage.GetElement(new EducationStatusSearchModel { Id = student.Value.EducationStatusId })?.Name ?? "не удалось получить"))
|
|
||||||
.ToList()
|
|
||||||
})
|
|
||||||
.ToList();
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void SaveBlanksToWordFile(ReportBindingModel model)
|
public byte[] SaveListFile(StreamStudentBindingModel model)
|
||||||
|
{
|
||||||
|
byte[] file = Array.Empty<byte>();
|
||||||
|
|
||||||
|
string title = "Список студентов по потоку " + model.StreamName;
|
||||||
|
|
||||||
|
if (model.FileType == "docx")
|
||||||
|
{
|
||||||
|
_wordBuilder.CreateDocument();
|
||||||
|
_wordBuilder.CreateTitle(title);
|
||||||
|
_wordBuilder.CreateStudentsStatusTable(model.Students);
|
||||||
|
file = _wordBuilder.GetFile();
|
||||||
|
}
|
||||||
|
else if (model.FileType == "xlsx")
|
||||||
|
{
|
||||||
|
_excelBuilder.CreateDocument();
|
||||||
|
_excelBuilder.CreateTitle(title);
|
||||||
|
_excelBuilder.CreateStudentsDisciplineTable(model.Students);
|
||||||
|
file = _excelBuilder.GetFile();
|
||||||
|
}
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendByMailStatusReport(ReportBindingModel reportModel)
|
||||||
|
{
|
||||||
|
/*byte[] file = _pdfBuilder.GetEducationStatusReportFile(new()
|
||||||
|
{
|
||||||
|
Title = "Отчет по статусам обучения",
|
||||||
|
DateFrom = reportModel.DateFrom,
|
||||||
|
DateTo = reportModel.DateTo,
|
||||||
|
Records = GetStreamStudentEdStatPeriod(reportModel)
|
||||||
|
});
|
||||||
|
_mailSender.SendMailAsync(new()
|
||||||
|
{
|
||||||
|
MailAddress = reportModel.UserEmail,
|
||||||
|
Subject = "Отчет по статусам обучения",
|
||||||
|
Text = $"За период с {reportModel.DateFrom.ToShortDateString()} " +
|
||||||
|
$"по {reportModel.DateTo.ToShortDateString()}.",
|
||||||
|
File = file
|
||||||
|
});*/
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ReportDisciplineViewModel> IReportCustomerLogic.GetDiscipline(ReportBindingModel model)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveDocumentBlankToExcelFile(ReportBindingModel model)
|
List<ReportStreamEducationStatusViewModel> IReportCustomerLogic.StreamEducationStatus(List<StreamViewModel> streams)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveOrdersToPdfFile(ReportBindingModel model)
|
|
||||||
|
void IReportCustomerLogic.SendByMailStatusReport(ReportBindingModel reportModel)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
@ -112,5 +112,10 @@ namespace UniversityBusinessLogic.BusinessLogics
|
|||||||
throw new InvalidOperationException("Студент с таким номером студенческого билета уже есть");
|
throw new InvalidOperationException("Студент с таким номером студенческого билета уже есть");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<StudentViewModel> GetStudentsFromStream(int streamId)
|
||||||
|
{
|
||||||
|
return _studentStorage.GetStudentsFromStream(streamId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
344
UniversityBusinessLogic/OfficePackage/ExcelBuilderCustomer.cs
Normal file
344
UniversityBusinessLogic/OfficePackage/ExcelBuilderCustomer.cs
Normal file
@ -0,0 +1,344 @@
|
|||||||
|
using DocumentFormat.OpenXml.Packaging;
|
||||||
|
using DocumentFormat.OpenXml.Spreadsheet;
|
||||||
|
using DocumentFormat.OpenXml;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UniversityBusinessLogic.OfficePackage.Models;
|
||||||
|
using UniversityContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace UniversityBusinessLogic.OfficePackage
|
||||||
|
{
|
||||||
|
public class ExcelBuilderCustomer
|
||||||
|
{
|
||||||
|
private readonly string tempFileName = "temp.xlsx";
|
||||||
|
private SpreadsheetDocument? spreadsheetDocument;
|
||||||
|
private SharedStringTablePart? shareStringPart;
|
||||||
|
private Worksheet? worksheet;
|
||||||
|
|
||||||
|
private void CreateStyles(WorkbookPart workbookpart)
|
||||||
|
{
|
||||||
|
var sp = workbookpart.AddNewPart<WorkbookStylesPart>();
|
||||||
|
sp.Stylesheet = new Stylesheet();
|
||||||
|
|
||||||
|
var fonts = new Fonts() { Count = 2U, KnownFonts = true };
|
||||||
|
|
||||||
|
var fontUsual = new Font();
|
||||||
|
fontUsual.Append(new FontSize() { Val = 12D });
|
||||||
|
fonts.Append(fontUsual);
|
||||||
|
|
||||||
|
var fontTitle = new Font();
|
||||||
|
fontTitle.Append(new Bold());
|
||||||
|
fontTitle.Append(new FontSize() { Val = 12D });
|
||||||
|
fonts.Append(fontTitle);
|
||||||
|
|
||||||
|
var fills = new Fills() { Count = 3U };
|
||||||
|
|
||||||
|
var fill1 = new Fill();
|
||||||
|
fill1.Append(new PatternFill()
|
||||||
|
{
|
||||||
|
PatternType = PatternValues.None
|
||||||
|
});
|
||||||
|
|
||||||
|
var fill2 = new Fill();
|
||||||
|
fill2.Append(new PatternFill()
|
||||||
|
{
|
||||||
|
PatternType = PatternValues.Gray125
|
||||||
|
});
|
||||||
|
|
||||||
|
var fill3 = new Fill();
|
||||||
|
fill3.Append(new PatternFill()
|
||||||
|
{
|
||||||
|
PatternType = PatternValues.Solid,
|
||||||
|
ForegroundColor = new()
|
||||||
|
{
|
||||||
|
Rgb = "e0e8ff"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var fill4 = new Fill();
|
||||||
|
fill1.Append(new PatternFill()
|
||||||
|
{
|
||||||
|
PatternType = PatternValues.None
|
||||||
|
});
|
||||||
|
|
||||||
|
fills.Append(fill1);
|
||||||
|
fills.Append(fill2);
|
||||||
|
fills.Append(fill3);
|
||||||
|
fills.Append(fill4);
|
||||||
|
|
||||||
|
var borders = new Borders() { Count = 2U };
|
||||||
|
|
||||||
|
var borderNoBorder = new Border();
|
||||||
|
borderNoBorder.Append(new LeftBorder());
|
||||||
|
borderNoBorder.Append(new RightBorder());
|
||||||
|
borderNoBorder.Append(new TopBorder());
|
||||||
|
borderNoBorder.Append(new BottomBorder());
|
||||||
|
borderNoBorder.Append(new DiagonalBorder());
|
||||||
|
|
||||||
|
var borderThin = new Border();
|
||||||
|
|
||||||
|
var leftBorder = new LeftBorder() { Style = BorderStyleValues.Thin };
|
||||||
|
leftBorder.Append(new DocumentFormat.OpenXml.Office2010.Excel.Color() { Indexed = 64U });
|
||||||
|
var rightBorder = new RightBorder() { Style = BorderStyleValues.Thin };
|
||||||
|
rightBorder.Append(new DocumentFormat.OpenXml.Office2010.Excel.Color() { Indexed = 64U });
|
||||||
|
var topBorder = new TopBorder() { Style = BorderStyleValues.Thin };
|
||||||
|
topBorder.Append(new DocumentFormat.OpenXml.Office2010.Excel.Color() { Indexed = 64U });
|
||||||
|
var bottomBorder = new BottomBorder() { Style = BorderStyleValues.Thin };
|
||||||
|
bottomBorder.Append(new DocumentFormat.OpenXml.Office2010.Excel.Color() { Indexed = 64U });
|
||||||
|
|
||||||
|
borderThin.Append(leftBorder);
|
||||||
|
borderThin.Append(rightBorder);
|
||||||
|
borderThin.Append(topBorder);
|
||||||
|
borderThin.Append(bottomBorder);
|
||||||
|
borderThin.Append(new DiagonalBorder());
|
||||||
|
|
||||||
|
borders.Append(borderNoBorder);
|
||||||
|
borders.Append(borderThin);
|
||||||
|
|
||||||
|
CellFormats cellFormats = new() { Count = 4U };
|
||||||
|
CellFormat cellFormatEmpty = new()
|
||||||
|
{
|
||||||
|
FontId = 0U,
|
||||||
|
FillId = 0U,
|
||||||
|
BorderId = 1U,
|
||||||
|
ApplyFont = true
|
||||||
|
};
|
||||||
|
CellFormat cellFormatDefault = new()
|
||||||
|
{
|
||||||
|
FontId = 0U,
|
||||||
|
FillId = 3U,
|
||||||
|
BorderId = 1U,
|
||||||
|
ApplyFont = true
|
||||||
|
};
|
||||||
|
CellFormat cellFormatTitle = new()
|
||||||
|
{
|
||||||
|
FontId = 1U,
|
||||||
|
FillId = 2U,
|
||||||
|
BorderId = 1U,
|
||||||
|
ApplyFont = true,
|
||||||
|
ApplyBorder = true,
|
||||||
|
Alignment = new Alignment()
|
||||||
|
{
|
||||||
|
Vertical = VerticalAlignmentValues.Center,
|
||||||
|
Horizontal = HorizontalAlignmentValues.Center,
|
||||||
|
WrapText = true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
cellFormats.Append(cellFormatEmpty);
|
||||||
|
cellFormats.Append(cellFormatDefault);
|
||||||
|
cellFormats.Append(cellFormatTitle);
|
||||||
|
|
||||||
|
sp.Stylesheet.Append(fonts);
|
||||||
|
sp.Stylesheet.Append(fills);
|
||||||
|
sp.Stylesheet.Append(borders);
|
||||||
|
sp.Stylesheet.Append(cellFormats);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateDocument()
|
||||||
|
{
|
||||||
|
spreadsheetDocument = SpreadsheetDocument.Create(tempFileName,
|
||||||
|
SpreadsheetDocumentType.Workbook);
|
||||||
|
WorkbookPart workbookpart = spreadsheetDocument.AddWorkbookPart();
|
||||||
|
workbookpart.Workbook = new Workbook();
|
||||||
|
|
||||||
|
CreateStyles(workbookpart);
|
||||||
|
|
||||||
|
shareStringPart = spreadsheetDocument.WorkbookPart!
|
||||||
|
.GetPartsOfType<SharedStringTablePart>()
|
||||||
|
.Any()
|
||||||
|
? spreadsheetDocument.WorkbookPart
|
||||||
|
.GetPartsOfType<SharedStringTablePart>()
|
||||||
|
.First()
|
||||||
|
: spreadsheetDocument.WorkbookPart
|
||||||
|
.AddNewPart<SharedStringTablePart>();
|
||||||
|
|
||||||
|
if (shareStringPart.SharedStringTable == null)
|
||||||
|
{
|
||||||
|
shareStringPart.SharedStringTable = new SharedStringTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
WorksheetPart worksheetPart = workbookpart.AddNewPart<WorksheetPart>();
|
||||||
|
worksheetPart.Worksheet = new Worksheet(new SheetData());
|
||||||
|
|
||||||
|
Sheets sheets = spreadsheetDocument.WorkbookPart.Workbook.AppendChild(new Sheets());
|
||||||
|
Sheet sheet = new()
|
||||||
|
{
|
||||||
|
Id = spreadsheetDocument.WorkbookPart.GetIdOfPart(worksheetPart),
|
||||||
|
SheetId = 1,
|
||||||
|
Name = "Лист"
|
||||||
|
};
|
||||||
|
sheets.Append(sheet);
|
||||||
|
|
||||||
|
worksheet = worksheetPart.Worksheet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InsertCellInWorksheet(ExcelCellData cellData)
|
||||||
|
{
|
||||||
|
if (worksheet == null || shareStringPart == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var sheetData = worksheet.GetFirstChild<SheetData>();
|
||||||
|
if (sheetData == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Row? row = sheetData.Elements<Row>()
|
||||||
|
.Where(r => r.RowIndex! == cellData.RowIndex)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (row == null)
|
||||||
|
{
|
||||||
|
row = new Row() { RowIndex = cellData.RowIndex };
|
||||||
|
sheetData.Append(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
Cell? cell = row.Elements<Cell>()
|
||||||
|
.Where(c => c.CellReference!.Value == cellData.CellReference)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (cell == null)
|
||||||
|
{
|
||||||
|
Cell? refCell = null;
|
||||||
|
foreach (Cell rowCell in row.Elements<Cell>())
|
||||||
|
{
|
||||||
|
if (string.Compare(rowCell.CellReference!.Value, cellData.CellReference, true) > 0)
|
||||||
|
{
|
||||||
|
refCell = rowCell;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var newCell = new Cell()
|
||||||
|
{
|
||||||
|
CellReference = cellData.CellReference
|
||||||
|
};
|
||||||
|
row.InsertBefore(newCell, refCell);
|
||||||
|
cell = newCell;
|
||||||
|
}
|
||||||
|
|
||||||
|
shareStringPart.SharedStringTable.AppendChild(new SharedStringItem(new Text(cellData.Text)));
|
||||||
|
shareStringPart.SharedStringTable.Save();
|
||||||
|
cell.CellValue = new CellValue((shareStringPart.SharedStringTable.Elements<SharedStringItem>().Count() - 1).ToString());
|
||||||
|
cell.DataType = new EnumValue<CellValues>(CellValues.SharedString);
|
||||||
|
cell.StyleIndex = cellData.StyleIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MergeCells(ExcelMergeParameters excelParams)
|
||||||
|
{
|
||||||
|
if (worksheet == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MergeCells mergeCells;
|
||||||
|
if (worksheet.Elements<MergeCells>().Any())
|
||||||
|
{
|
||||||
|
mergeCells = worksheet.Elements<MergeCells>().First();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mergeCells = new MergeCells();
|
||||||
|
if (worksheet.Elements<CustomSheetView>().Any())
|
||||||
|
{
|
||||||
|
worksheet.InsertAfter(mergeCells, worksheet.Elements<CustomSheetView>().First());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
worksheet.InsertAfter(mergeCells, worksheet.Elements<SheetData>().First());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var mergeCell = new MergeCell()
|
||||||
|
{
|
||||||
|
Reference = new StringValue(excelParams.Merge)
|
||||||
|
};
|
||||||
|
mergeCells.Append(mergeCell);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Save()
|
||||||
|
{
|
||||||
|
if (spreadsheetDocument == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
spreadsheetDocument.WorkbookPart!.Workbook.Save();
|
||||||
|
spreadsheetDocument.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] GetFile()
|
||||||
|
{
|
||||||
|
Save();
|
||||||
|
byte[] file = File.ReadAllBytes(tempFileName);
|
||||||
|
File.Delete(tempFileName);
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateTitle(string text)
|
||||||
|
{
|
||||||
|
MergeCells(new ExcelMergeParameters
|
||||||
|
{
|
||||||
|
CellFromName = "A1",
|
||||||
|
CellToName = "B1"
|
||||||
|
});
|
||||||
|
InsertCellInWorksheet(new ExcelCellData
|
||||||
|
{
|
||||||
|
ColumnName = "A",
|
||||||
|
RowIndex = 1,
|
||||||
|
Text = text,
|
||||||
|
StyleIndex = 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateStudentsDisciplineTable(List<StudentViewModel> students)
|
||||||
|
{
|
||||||
|
if (worksheet == null || shareStringPart == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Columns columns = new();
|
||||||
|
Column columnA = new() { Min = 1, Max = 1, Width = 30, CustomWidth = true };
|
||||||
|
columns.Append(columnA);
|
||||||
|
Column columnB = new() { Min = 2, Max = 2, Width = 30, CustomWidth = true };
|
||||||
|
columns.Append(columnB);
|
||||||
|
worksheet.InsertAt(columns, 0);
|
||||||
|
|
||||||
|
InsertCellInWorksheet(new ExcelCellData
|
||||||
|
{
|
||||||
|
ColumnName = "A",
|
||||||
|
RowIndex = 2,
|
||||||
|
Text = "Студент",
|
||||||
|
StyleIndex = 2
|
||||||
|
});
|
||||||
|
InsertCellInWorksheet(new ExcelCellData
|
||||||
|
{
|
||||||
|
ColumnName = "B",
|
||||||
|
RowIndex = 2,
|
||||||
|
Text = "Дисциплина",
|
||||||
|
StyleIndex = 2
|
||||||
|
});
|
||||||
|
|
||||||
|
uint currentRow = 3;
|
||||||
|
foreach (StudentViewModel student in students)
|
||||||
|
{
|
||||||
|
InsertCellInWorksheet(new ExcelCellData
|
||||||
|
{
|
||||||
|
ColumnName = "A",
|
||||||
|
RowIndex = currentRow,
|
||||||
|
Text = student.Name + " " + student.Surname,
|
||||||
|
StyleIndex = 1
|
||||||
|
});
|
||||||
|
InsertCellInWorksheet(new ExcelCellData
|
||||||
|
{
|
||||||
|
ColumnName = "B",
|
||||||
|
RowIndex = currentRow,
|
||||||
|
Text = student.EducationStatusName,
|
||||||
|
StyleIndex = 1
|
||||||
|
});
|
||||||
|
currentRow++;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -164,7 +164,7 @@ namespace UniversityBusinessLogic.BusinessLogic.OfficePackage
|
|||||||
if (k < studentsAndStatus.Count)
|
if (k < studentsAndStatus.Count)
|
||||||
{
|
{
|
||||||
cellsData[1] = studentsAndStatus[k].StudentName;
|
cellsData[1] = studentsAndStatus[k].StudentName;
|
||||||
cellsData[2] = studentsAndStatus[k].DateOfAddmission.ToString("yyyy-MM-dd");
|
//cellsData[2] = studentsAndStatus[k].DateOfAddmission.ToString("yyyy-MM-dd");
|
||||||
cellsData[3] = studentsAndStatus[k].EducationStatus;
|
cellsData[3] = studentsAndStatus[k].EducationStatus;
|
||||||
}
|
}
|
||||||
CreateRow(new PdfRowParameters
|
CreateRow(new PdfRowParameters
|
||||||
|
171
UniversityBusinessLogic/OfficePackage/WordBuilderCustomer.cs
Normal file
171
UniversityBusinessLogic/OfficePackage/WordBuilderCustomer.cs
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
using DocumentFormat.OpenXml.Packaging;
|
||||||
|
using DocumentFormat.OpenXml.Wordprocessing;
|
||||||
|
using DocumentFormat.OpenXml;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UniversityBusinessLogic.OfficePackage.Models;
|
||||||
|
using UniversityContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace UniversityBusinessLogic.OfficePackage
|
||||||
|
{
|
||||||
|
public class WordBuilderCustomer
|
||||||
|
{
|
||||||
|
|
||||||
|
private readonly string tempFileName = "temp.docx";
|
||||||
|
private WordprocessingDocument? wordDocument;
|
||||||
|
private Body? documentBody;
|
||||||
|
|
||||||
|
public void CreateDocument()
|
||||||
|
{
|
||||||
|
wordDocument = WordprocessingDocument.Create(tempFileName,
|
||||||
|
WordprocessingDocumentType.Document);
|
||||||
|
MainDocumentPart mainPart = wordDocument.AddMainDocumentPart();
|
||||||
|
mainPart.Document = new Document();
|
||||||
|
documentBody = mainPart.Document.AppendChild(new Body());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateParagraph(string text)
|
||||||
|
{
|
||||||
|
if (documentBody == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Paragraph paragraph = new();
|
||||||
|
Run run = new();
|
||||||
|
run.AppendChild(new Text
|
||||||
|
{
|
||||||
|
Text = text
|
||||||
|
});
|
||||||
|
paragraph.AppendChild(run);
|
||||||
|
documentBody.AppendChild(paragraph);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateTitle(string text)
|
||||||
|
{
|
||||||
|
if (documentBody == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Paragraph paragraph = new();
|
||||||
|
Run run = new();
|
||||||
|
RunProperties properties = new();
|
||||||
|
properties.AppendChild(new Bold());
|
||||||
|
run.AppendChild(properties);
|
||||||
|
run.AppendChild(new Text
|
||||||
|
{
|
||||||
|
Text = text
|
||||||
|
});
|
||||||
|
paragraph.AppendChild(run);
|
||||||
|
documentBody.AppendChild(paragraph);
|
||||||
|
}
|
||||||
|
|
||||||
|
private TableCell CreateTableCell(string text, bool inHead = false, int? cellWidth = null)
|
||||||
|
{
|
||||||
|
Run run = new();
|
||||||
|
TableCell tableCell = new();
|
||||||
|
TableCellProperties cellProperties = new()
|
||||||
|
{
|
||||||
|
TableCellWidth = new()
|
||||||
|
{
|
||||||
|
Width = cellWidth.ToString()
|
||||||
|
},
|
||||||
|
TableCellMargin = new()
|
||||||
|
{
|
||||||
|
LeftMargin = new()
|
||||||
|
{
|
||||||
|
Width = "100"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (inHead)
|
||||||
|
{
|
||||||
|
Shading shading = new()
|
||||||
|
{
|
||||||
|
Color = "auto",
|
||||||
|
Fill = "e0e8ff",
|
||||||
|
Val = ShadingPatternValues.Clear
|
||||||
|
};
|
||||||
|
cellProperties.Append(shading);
|
||||||
|
RunProperties properties = new();
|
||||||
|
properties.AppendChild(new Bold());
|
||||||
|
run.AppendChild(properties);
|
||||||
|
}
|
||||||
|
run.AppendChild(new Text
|
||||||
|
{
|
||||||
|
Text = text
|
||||||
|
});
|
||||||
|
Paragraph paragraph = new(run);
|
||||||
|
tableCell.AppendChild(paragraph);
|
||||||
|
tableCell.Append(cellProperties);
|
||||||
|
return tableCell;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void CreateTable(WordTableData tableData)
|
||||||
|
{
|
||||||
|
if (documentBody == null || tableData == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var table = new Table();
|
||||||
|
|
||||||
|
TableProperties tableProperties = new(
|
||||||
|
new TableBorders(
|
||||||
|
new TopBorder() { Val = new EnumValue<BorderValues>(BorderValues.Single), Size = 3 },
|
||||||
|
new BottomBorder() { Val = new EnumValue<BorderValues>(BorderValues.Single), Size = 3 },
|
||||||
|
new LeftBorder() { Val = new EnumValue<BorderValues>(BorderValues.Single), Size = 3 },
|
||||||
|
new RightBorder() { Val = new EnumValue<BorderValues>(BorderValues.Single), Size = 3 },
|
||||||
|
new InsideHorizontalBorder() { Val = new EnumValue<BorderValues>(BorderValues.Single), Size = 3 },
|
||||||
|
new InsideVerticalBorder() { Val = new EnumValue<BorderValues>(BorderValues.Single), Size = 3 }
|
||||||
|
)
|
||||||
|
);
|
||||||
|
table.AppendChild(tableProperties);
|
||||||
|
|
||||||
|
table.Append(new TableRow(tableData.Columns.Select(x => CreateTableCell(x.Item1, true, x.Item2))));
|
||||||
|
table.Append(tableData.Rows.Select(x => new TableRow(x.Select(y => CreateTableCell(y)))));
|
||||||
|
|
||||||
|
documentBody.AppendChild(table);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Save()
|
||||||
|
{
|
||||||
|
if (documentBody == null || wordDocument == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
wordDocument.MainDocumentPart!.Document.Save();
|
||||||
|
wordDocument.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] GetFile()
|
||||||
|
{
|
||||||
|
Save();
|
||||||
|
byte[] file = File.ReadAllBytes(tempFileName);
|
||||||
|
File.Delete(tempFileName);
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateStudentsStatusTable(List<StudentViewModel> students)
|
||||||
|
{
|
||||||
|
List<List<string>> rows = new();
|
||||||
|
|
||||||
|
|
||||||
|
foreach(StudentViewModel student in students) {
|
||||||
|
List<string> studentCells = new() { student.Name + " " + student.Surname, student.EducationStatusName };
|
||||||
|
rows.Add(studentCells);
|
||||||
|
}
|
||||||
|
WordTableData wordTable = new()
|
||||||
|
{
|
||||||
|
Columns = new List<(string, int)>()
|
||||||
|
{
|
||||||
|
("Студент", 3000),
|
||||||
|
("Cтатус", 3000)
|
||||||
|
},
|
||||||
|
Rows = rows
|
||||||
|
};
|
||||||
|
CreateTable(wordTable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -10,6 +10,7 @@ namespace UniversityContracts.BindingModels
|
|||||||
public class StreamStudentBindingModel
|
public class StreamStudentBindingModel
|
||||||
{
|
{
|
||||||
public string FileType { get; set; } = string.Empty;
|
public string FileType { get; set; } = string.Empty;
|
||||||
|
public string StreamName { get; set; }
|
||||||
public List<StudentViewModel> Students { get; set; } = new();
|
public List<StudentViewModel> Students { get; set; } = new();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,5 +17,6 @@ namespace UniversityContracts.BusinessLogicContracts
|
|||||||
List<StudentViewModel>? ReadList(StudentSearchModel? model);
|
List<StudentViewModel>? ReadList(StudentSearchModel? model);
|
||||||
StudentViewModel? ReadElement(StudentSearchModel model);
|
StudentViewModel? ReadElement(StudentSearchModel model);
|
||||||
int GetNumberOfPages(int userId, int pageSize = 10);
|
int GetNumberOfPages(int userId, int pageSize = 10);
|
||||||
|
List<StudentViewModel> GetStudentsFromStream(int streamId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ namespace UniversityContracts.StoragesContracts
|
|||||||
StudentViewModel? Update(StudentBindingModel model);
|
StudentViewModel? Update(StudentBindingModel model);
|
||||||
StudentViewModel? Delete(StudentBindingModel model);
|
StudentViewModel? Delete(StudentBindingModel model);
|
||||||
List<StreamViewModel> GetStudentStreams(StudentSearchModel model);
|
List<StreamViewModel> GetStudentStreams(StudentSearchModel model);
|
||||||
|
List<StudentViewModel> GetStudentsFromStream(int streamId);
|
||||||
int GetNumberOfPages(int userId, int pageSize);
|
int GetNumberOfPages(int userId, int pageSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ namespace UniversityContracts.ViewModels
|
|||||||
public class StudentStatusViewModel
|
public class StudentStatusViewModel
|
||||||
{
|
{
|
||||||
public string StudentName { get; set; } = string.Empty;
|
public string StudentName { get; set; } = string.Empty;
|
||||||
public DateTime DateOfAddmission { get; set; }
|
public DateTime? DateOfAddmission { get; set; }
|
||||||
public string EducationStatus { get; set; } = string.Empty;
|
public string EducationStatus { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,11 @@ namespace UniversityProvider.Controllers
|
|||||||
($"api/stream/getnumberofpages?userId={APIClient.User.Id}");
|
($"api/stream/getnumberofpages?userId={APIClient.User.Id}");
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
public List<EducationStatusViewModel> Status()
|
||||||
|
{
|
||||||
|
return APIClient.GetRequest<List<EducationStatusViewModel>>
|
||||||
|
($"api/educationstatus/getall");
|
||||||
|
}
|
||||||
public IActionResult EducationGroups(int page)
|
public IActionResult EducationGroups(int page)
|
||||||
{
|
{
|
||||||
if (APIClient.User == null)
|
if (APIClient.User == null)
|
||||||
|
@ -16,6 +16,7 @@ namespace UniversityRestAPI.Controllers
|
|||||||
this.reportLogic = reportLogic;
|
this.reportLogic = reportLogic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public byte[] StreamStudentList(StreamStudentBindingModel listModel)
|
public byte[] StreamStudentList(StreamStudentBindingModel listModel)
|
||||||
{
|
{
|
||||||
|
@ -30,22 +30,5 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-4">
|
|
||||||
<div class="scrollable-table">
|
|
||||||
<table class="table table-bordered">
|
|
||||||
<thead class="thead-light">
|
|
||||||
<tr>
|
|
||||||
<th>Имя</th>
|
|
||||||
<th>Фамилия</th>
|
|
||||||
<th>Дата рождения</th>
|
|
||||||
<th>Номер студ. билета</th>
|
|
||||||
<th>Статус обучения</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody id="scrollable-table__tbody">
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="~/js/report/reportlist.js" asp-append-version="true"></script>
|
<script src="~/js/report/reportlist.js" asp-append-version="true"></script>
|
@ -34,12 +34,27 @@ createBtn.addEventListener('click', async () => {
|
|||||||
type: "GET",
|
type: "GET",
|
||||||
contentType: "json"
|
contentType: "json"
|
||||||
});
|
});
|
||||||
|
console.log(st);
|
||||||
|
const edst = await $.ajax({
|
||||||
|
url: `status`,
|
||||||
|
type: "GET",
|
||||||
|
contentType: "json"
|
||||||
|
});
|
||||||
|
console.log(edst);
|
||||||
|
console.log(select[select.selectedIndex].innerHTML);
|
||||||
students = st.studentStream;
|
students = st.studentStream;
|
||||||
students.forEach((student) => {
|
students.forEach((student) => {
|
||||||
createRowForStudentsTable(student);
|
edst.forEach((status) => {
|
||||||
})
|
if (student.educationStatusId = status.id) {
|
||||||
|
student.educationStatusName = status.name
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
let listModel = {
|
let listModel = {
|
||||||
"Students": Array.from(dataArray),
|
"StreamName": select[select.selectedIndex].innerHTML,
|
||||||
|
"Students": Array.from(students),
|
||||||
"FileType": fileType.value
|
"FileType": fileType.value
|
||||||
};
|
};
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -48,6 +63,7 @@ createBtn.addEventListener('click', async () => {
|
|||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
data: JSON.stringify(listModel)
|
data: JSON.stringify(listModel)
|
||||||
}).done((file) => {
|
}).done((file) => {
|
||||||
|
console.log(file);
|
||||||
let byteArray = new Uint8Array(file);
|
let byteArray = new Uint8Array(file);
|
||||||
saveFile(byteArray, fileType);
|
saveFile(byteArray, fileType);
|
||||||
});
|
});
|
||||||
|
@ -10,7 +10,7 @@ namespace UniversityDataBaseImplemet
|
|||||||
{
|
{
|
||||||
if (optionsBuilder.IsConfigured == false)
|
if (optionsBuilder.IsConfigured == false)
|
||||||
{
|
{
|
||||||
optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=UniversityCourseWork;Username=postgres;Password=4757");
|
optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=UniversityCourseWork;Username=postgres;Password=0000");
|
||||||
}
|
}
|
||||||
base.OnConfiguring(optionsBuilder);
|
base.OnConfiguring(optionsBuilder);
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,11 @@ namespace UniversityDataBaseImplemet.Implements
|
|||||||
|| record.Name.Equals(model.Name))
|
|| record.Name.Equals(model.Name))
|
||||||
?.GetViewModel;
|
?.GetViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<StreamViewModel> GetFilteredList(StreamSearchModel model)
|
public List<StreamViewModel> GetFilteredList(StreamSearchModel model)
|
||||||
{
|
{
|
||||||
using var context = new Database();
|
using var context = new Database();
|
||||||
|
@ -100,6 +100,19 @@ namespace UniversityDataBaseImplemet.Implements
|
|||||||
.Select(record => record.GetViewModel)
|
.Select(record => record.GetViewModel)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<StudentViewModel> GetStudentsFromStream(int streamId)
|
||||||
|
{
|
||||||
|
using var context = new Database();
|
||||||
|
return context.StudentStreams
|
||||||
|
.Include(x => x.Student)
|
||||||
|
.Where(x => x.StreamId == streamId)
|
||||||
|
.Select(x => x.Student.GetViewModel)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public StudentViewModel? Insert(StudentBindingModel model)
|
public StudentViewModel? Insert(StudentBindingModel model)
|
||||||
{
|
{
|
||||||
var newStudent = Student.Create(model);
|
var newStudent = Student.Create(model);
|
||||||
|
@ -29,6 +29,19 @@ namespace UniversityRestAPI.Controllers
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[HttpGet]
|
||||||
|
public List<EducationStatusViewModel>? GetAll()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return _educationStatusLogic.ReadList(null);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public List<EducationStatusViewModel>? GetAllByUser(int userId)
|
public List<EducationStatusViewModel>? GetAllByUser(int userId)
|
||||||
|
@ -19,6 +19,7 @@ namespace UniversityRestAPI.Controllers
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public byte[] StreamStudentList(StreamStudentBindingModel listModel)
|
public byte[] StreamStudentList(StreamStudentBindingModel listModel)
|
||||||
{
|
{
|
||||||
|
Console.BackgroundColor = ConsoleColor.Green;
|
||||||
byte[] file = reportLogic.SaveListFile(listModel);
|
byte[] file = reportLogic.SaveListFile(listModel);
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
@ -146,5 +146,17 @@ namespace UniversityRestAPI.Controllers
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[HttpGet]
|
||||||
|
public List<StudentViewModel> GetStudentsFromStream(int streamId ) {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
return _studentLogic.GetStudentsFromStream(streamId);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,12 @@ builder.Services.AddTransient<IEducationGroupLogic, EducationGroupLogic>();
|
|||||||
builder.Services.AddTransient<IDisciplineLogic, DisciplineLogic>();
|
builder.Services.AddTransient<IDisciplineLogic, DisciplineLogic>();
|
||||||
builder.Services.AddTransient<IStreamLogic, StreamLogic>();
|
builder.Services.AddTransient<IStreamLogic, StreamLogic>();
|
||||||
builder.Services.AddTransient<IReportProviderLogic, ReportProviderLogic>();
|
builder.Services.AddTransient<IReportProviderLogic, ReportProviderLogic>();
|
||||||
|
builder.Services.AddTransient<IReportCustomerLogic, ReportCustomerLogic>();
|
||||||
|
|
||||||
builder.Services.AddTransient<WordBuilderProvider>();
|
builder.Services.AddTransient<WordBuilderProvider>();
|
||||||
|
builder.Services.AddTransient<WordBuilderCustomer>();
|
||||||
builder.Services.AddTransient<ExcelBuilderProvider>();
|
builder.Services.AddTransient<ExcelBuilderProvider>();
|
||||||
|
builder.Services.AddTransient<ExcelBuilderCustomer>();
|
||||||
builder.Services.AddTransient<PdfBuilderProvider>();
|
builder.Services.AddTransient<PdfBuilderProvider>();
|
||||||
|
|
||||||
builder.Services.AddSingleton<MailSender>();
|
builder.Services.AddSingleton<MailSender>();
|
||||||
|
Loading…
Reference in New Issue
Block a user