зафиксировать

This commit is contained in:
Kristina 2024-03-29 10:44:40 +04:00
parent 457650f9e0
commit c029ef7436
4 changed files with 17 additions and 45 deletions

View File

@ -52,7 +52,7 @@
panelTop.Name = "panelTop";
panelTop.Size = new Size(1109, 71);
panelTop.TabIndex = 0;
panelTop.Paint += panelTop_Paint;
//panelTop.Paint += panelTop_Paint;
//
// ToPdfButton
//
@ -111,7 +111,7 @@
dateTimePickerFrom.Name = "dateTimePickerFrom";
dateTimePickerFrom.Size = new Size(284, 31);
dateTimePickerFrom.TabIndex = 0;
dateTimePickerFrom.ValueChanged += dateTimePickerFrom_ValueChanged;
//dateTimePickerFrom.ValueChanged += dateTimePickerFrom_ValueChanged;
//
// panelReport
//
@ -120,7 +120,7 @@
panelReport.Name = "panelReport";
panelReport.Size = new Size(1110, 635);
panelReport.TabIndex = 1;
panelReport.Paint += panelReport_Paint;
//panelReport.Paint += panelReport_Paint;
//
// FormReportOrders
//

View File

@ -96,20 +96,5 @@ namespace BlacksmithWorkshop
}
}
}
private void panelReport_Paint(object sender, PaintEventArgs e)
{
}
private void panelTop_Paint(object sender, PaintEventArgs e)
{
}
private void dateTimePickerFrom_ValueChanged(object sender, EventArgs e)
{
}
}
}

View File

@ -10,11 +10,13 @@ namespace BlacksmithWorkshopBusinessLogic.OfficePackage
{
public abstract class AbstractSaveToWord
{
//создание документа Word
public void CreateDoc(WordInfo info)
{
CreateWord(info);
CreateParagraph(new WordParagraph
{
//заголовок
Texts = new List<(string, WordTextProperties)> { (info.Title, new WordTextProperties { Bold = true, Size = "24", }) },
TextProperties = new WordTextProperties
{
@ -26,6 +28,7 @@ namespace BlacksmithWorkshopBusinessLogic.OfficePackage
{
CreateParagraph(new WordParagraph
{
//название жирным
Texts = new List<(string, WordTextProperties)> { (manufacture.ManufactureName, new WordTextProperties { Size = "24", Bold = true}),
(" - цена " + manufacture.Price.ToString(), new WordTextProperties { Size = "24"})
},
@ -38,21 +41,13 @@ namespace BlacksmithWorkshopBusinessLogic.OfficePackage
}
SaveWord(info);
}
/// <summary>
/// Создание doc-файла
/// </summary>
/// <param name="info"></param>
// Создание doc-файла
protected abstract void CreateWord(WordInfo info);
/// <summary>
/// Создание абзаца с текстом
/// </summary>
/// <param name="paragraph"></param>
/// <returns></returns>
// Создание абзаца с текстом
protected abstract void CreateParagraph(WordParagraph paragraph);
/// <summary>
/// Сохранение файла
/// </summary>
/// <param name="info"></param>
// Сохранение файла
protected abstract void SaveWord(WordInfo info);
}
}

View File

@ -15,11 +15,8 @@ namespace BlacksmithWorkshopBusinessLogic.OfficePackage.Implements
{
private WordprocessingDocument? _wordDocument;
private Body? _docBody;
/// <summary>
/// Получение типа выравнивания
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
// Получение типа выравнивания
private static JustificationValues GetJustificationValues(WordJustificationType type)
{
return type switch
@ -29,10 +26,8 @@ namespace BlacksmithWorkshopBusinessLogic.OfficePackage.Implements
_ => JustificationValues.Left,
};
}
/// <summary>
/// Настройки страницы
/// </summary>
/// <returns></returns>
// Настройки страницы
private static SectionProperties CreateSectionProperties()
{
var properties = new SectionProperties();
@ -43,11 +38,8 @@ namespace BlacksmithWorkshopBusinessLogic.OfficePackage.Implements
properties.AppendChild(pageSize);
return properties;
}
/// <summary>
/// Задание форматирования для абзаца
/// </summary>
/// <param name="paragraphProperties"></param>
/// <returns></returns>
// Задание форматирования для абзаца
private static ParagraphProperties? CreateParagraphProperties(
WordTextProperties? paragraphProperties)
{