凸( ̄ヘ ̄)

This commit is contained in:
Polina 2024-05-31 19:11:00 +04:00
parent ff7ff41707
commit 79ac3cf662
4 changed files with 43 additions and 40 deletions

View File

@ -29,9 +29,9 @@ namespace UniversityBusinessLogics.OfficePackage
CreateParagraph(new WordParagraph
{
Texts = new List<(string, WordTextProperties)>
{
(text, new WordTextProperties { Size = "24" })
},
{
(text, new WordTextProperties { Size = "24" })
},
TextProperties = new WordTextProperties
{
Size = "24",
@ -42,23 +42,23 @@ namespace UniversityBusinessLogics.OfficePackage
SaveWord(info);
}
/// <summary>
/// Создание doc-файла
/// </summary>
/// <param name="info"></param>
/// <summary>
/// Создание doc-файла
/// </summary>
/// <param name="info"></param>
protected abstract void CreateWord(WordInfo info);
/// <summary>
/// Создание абзаца с текстом
/// </summary>
/// <param name="paragraph"></param>
/// <returns></returns>
/// <summary>
/// Создание абзаца с текстом
/// </summary>
/// <param name="paragraph"></param>
/// <returns></returns>
protected abstract void CreateParagraph(WordParagraph paragraph);
/// <summary>
/// Сохранение файла
/// </summary>
/// <param name="info"></param>
/// <summary>
/// Сохранение файла
/// </summary>
/// <param name="info"></param>
protected abstract void SaveWord(WordInfo info);
}
}

View File

@ -188,17 +188,17 @@ namespace UniversityBusinessLogics.OfficePackage.Implements
_shareStringPart.SharedStringTable = new SharedStringTable();
}
// Create a new worksheet part
var workbookPart = _spreadsheetDocument.AddWorkbookPart();
workbookPart.Workbook = new Workbook();
// Создаем лист в книгу
var worksheetPart = workbookpart.AddNewPart<WorksheetPart>();
worksheetPart.Worksheet = new Worksheet(new SheetData());
// Set the new worksheet as the active worksheet
var sheets = workbookPart.Workbook.AppendChild(new Sheets());
var sheet = new Sheet
// Добавляем лист в книгу
var sheets = _spreadsheetDocument.WorkbookPart.Workbook.AppendChild(new Sheets());
var sheet = new Sheet()
{
Id = _spreadsheetDocument.WorkbookPart.GetIdOfPart(worksheetPart),
SheetId = (uint)sheets.ChildElements.Count + 1,
Name = "Sheet1" // You can change the name as needed
SheetId = 1,
Name = "Лист"
};
sheets.Append(sheet);
@ -290,7 +290,10 @@ namespace UniversityBusinessLogics.OfficePackage.Implements
}
}
var mergeCell = new MergeCell { Reference = excelParams.Merge };
var mergeCell = new MergeCell()
{
Reference = new StringValue(excelParams.Merge)
};
mergeCells.Append(mergeCell);
}

View File

@ -12,11 +12,11 @@ namespace UniversityBusinessLogics.OfficePackage.Implements
private Body? _docBody;
/// <summary>
/// Получение типа выравнивания
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
/// <summary>
/// Получение типа выравнивания
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
private static JustificationValues GetJustificationValues(WordJustificationType type)
{
return type switch
@ -27,10 +27,10 @@ namespace UniversityBusinessLogics.OfficePackage.Implements
};
}
/// <summary>
/// Настройки страницы
/// </summary>
/// <returns></returns>
/// <summary>
/// Настройки страницы
/// </summary>
/// <returns></returns>
private static SectionProperties CreateSectionProperties()
{
var properties = new SectionProperties();
@ -45,11 +45,11 @@ namespace UniversityBusinessLogics.OfficePackage.Implements
return properties;
}
/// <summary>
/// Задание форматирования для абзаца
/// </summary>
/// <param name="paragraphProperties"></param>
/// <returns></returns>
/// <summary>
/// Задание форматирования для абзаца
/// </summary>
/// <param name="paragraphProperties"></param>
/// <returns></returns>
private static ParagraphProperties? CreateParagraphProperties(WordTextProperties? paragraphProperties)
{
if (paragraphProperties == null)
@ -144,3 +144,4 @@ namespace UniversityBusinessLogics.OfficePackage.Implements
}
}
}

View File

@ -18,7 +18,6 @@ builder.Services.AddSession(); //
builder.Services.AddTransient<IClientLogic, ClientLogic>();
builder.Services.AddTransient<IPurchaseLogic, PurchaseLogic>();
builder.Services.AddTransient<IOperationLogic, OperationLogic>();
builder.Services.AddTransient<IReportLogic, ReportLogic>();
builder.Services.AddTransient<IPaymentLogic, PaymentLogic>();
builder.Services.AddTransient<AbstractSaveToWord, SaveToWord>();