diff --git a/University/UniversityBusinessLogics/OfficePackage/AbstractSaveToWord.cs b/University/UniversityBusinessLogics/OfficePackage/AbstractSaveToWord.cs
index 87aae3e..b3f5402 100644
--- a/University/UniversityBusinessLogics/OfficePackage/AbstractSaveToWord.cs
+++ b/University/UniversityBusinessLogics/OfficePackage/AbstractSaveToWord.cs
@@ -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);
}
- ///
- /// Создание doc-файла
- ///
- ///
+ ///
+ /// Создание doc-файла
+ ///
+ ///
protected abstract void CreateWord(WordInfo info);
- ///
- /// Создание абзаца с текстом
- ///
- ///
- ///
+ ///
+ /// Создание абзаца с текстом
+ ///
+ ///
+ ///
protected abstract void CreateParagraph(WordParagraph paragraph);
- ///
- /// Сохранение файла
- ///
- ///
+ ///
+ /// Сохранение файла
+ ///
+ ///
protected abstract void SaveWord(WordInfo info);
}
}
diff --git a/University/UniversityBusinessLogics/OfficePackage/Implements/SaveToExcel.cs b/University/UniversityBusinessLogics/OfficePackage/Implements/SaveToExcel.cs
index 23020bd..de19041 100644
--- a/University/UniversityBusinessLogics/OfficePackage/Implements/SaveToExcel.cs
+++ b/University/UniversityBusinessLogics/OfficePackage/Implements/SaveToExcel.cs
@@ -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.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);
}
diff --git a/University/UniversityBusinessLogics/OfficePackage/Implements/SaveToWord.cs b/University/UniversityBusinessLogics/OfficePackage/Implements/SaveToWord.cs
index f9be513..9698176 100644
--- a/University/UniversityBusinessLogics/OfficePackage/Implements/SaveToWord.cs
+++ b/University/UniversityBusinessLogics/OfficePackage/Implements/SaveToWord.cs
@@ -12,11 +12,11 @@ namespace UniversityBusinessLogics.OfficePackage.Implements
private Body? _docBody;
- ///
- /// Получение типа выравнивания
- ///
- ///
- ///
+ ///
+ /// Получение типа выравнивания
+ ///
+ ///
+ ///
private static JustificationValues GetJustificationValues(WordJustificationType type)
{
return type switch
@@ -27,10 +27,10 @@ namespace UniversityBusinessLogics.OfficePackage.Implements
};
}
- ///
- /// Настройки страницы
- ///
- ///
+ ///
+ /// Настройки страницы
+ ///
+ ///
private static SectionProperties CreateSectionProperties()
{
var properties = new SectionProperties();
@@ -45,11 +45,11 @@ namespace UniversityBusinessLogics.OfficePackage.Implements
return properties;
}
- ///
- /// Задание форматирования для абзаца
- ///
- ///
- ///
+ ///
+ /// Задание форматирования для абзаца
+ ///
+ ///
+ ///
private static ParagraphProperties? CreateParagraphProperties(WordTextProperties? paragraphProperties)
{
if (paragraphProperties == null)
@@ -144,3 +144,4 @@ namespace UniversityBusinessLogics.OfficePackage.Implements
}
}
}
+
diff --git a/University/UniversityClientApp/Program.cs b/University/UniversityClientApp/Program.cs
index 50e4ed0..eaec648 100644
--- a/University/UniversityClientApp/Program.cs
+++ b/University/UniversityClientApp/Program.cs
@@ -18,7 +18,6 @@ builder.Services.AddSession(); //
builder.Services.AddTransient();
builder.Services.AddTransient();
builder.Services.AddTransient();
-builder.Services.AddTransient();
builder.Services.AddTransient();
builder.Services.AddTransient();