Готовая 4 лабораторная (Усложненная)
This commit is contained in:
parent
efd4e18131
commit
fef21f19a8
@ -14,17 +14,20 @@ namespace IceCreamShopBusinessLogic.BusinessLogics
|
|||||||
|
|
||||||
private readonly IOrderStorage _orderStorage;
|
private readonly IOrderStorage _orderStorage;
|
||||||
|
|
||||||
|
private readonly IShopStorage _shopStorage;
|
||||||
|
|
||||||
private readonly AbstractSaveToExcel _saveToExcel;
|
private readonly AbstractSaveToExcel _saveToExcel;
|
||||||
|
|
||||||
private readonly AbstractSaveToWord _saveToWord;
|
private readonly AbstractSaveToWord _saveToWord;
|
||||||
|
|
||||||
private readonly AbstractSaveToPdf _saveToPdf;
|
private readonly AbstractSaveToPdf _saveToPdf;
|
||||||
|
|
||||||
public ReportLogic(IIceCreamStorage iceCreamStorage, IComponentStorage componentStorage, IOrderStorage orderStorage,
|
public ReportLogic(IIceCreamStorage iceCreamStorage, IComponentStorage componentStorage, IOrderStorage orderStorage, IShopStorage shopStorage,
|
||||||
AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf)
|
AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf)
|
||||||
{
|
{
|
||||||
_iceCreamStorage = iceCreamStorage;
|
_iceCreamStorage = iceCreamStorage;
|
||||||
_orderStorage = orderStorage;
|
_orderStorage = orderStorage;
|
||||||
|
_shopStorage = shopStorage;
|
||||||
|
|
||||||
_saveToExcel = saveToExcel;
|
_saveToExcel = saveToExcel;
|
||||||
_saveToWord = saveToWord;
|
_saveToWord = saveToWord;
|
||||||
@ -33,7 +36,6 @@ namespace IceCreamShopBusinessLogic.BusinessLogics
|
|||||||
|
|
||||||
public List<ReportIceCreamComponentViewModel> GetIceCreamComponents()
|
public List<ReportIceCreamComponentViewModel> GetIceCreamComponents()
|
||||||
{
|
{
|
||||||
|
|
||||||
var iceCreams = _iceCreamStorage.GetFullList();
|
var iceCreams = _iceCreamStorage.GetFullList();
|
||||||
|
|
||||||
var list = new List<ReportIceCreamComponentViewModel>();
|
var list = new List<ReportIceCreamComponentViewModel>();
|
||||||
@ -58,6 +60,32 @@ namespace IceCreamShopBusinessLogic.BusinessLogics
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ReportShopIceCreamViewModel> GetShopIceCreams()
|
||||||
|
{
|
||||||
|
var shops = _shopStorage.GetFullList();
|
||||||
|
|
||||||
|
var list = new List<ReportShopIceCreamViewModel>();
|
||||||
|
|
||||||
|
foreach (var shop in shops)
|
||||||
|
{
|
||||||
|
var record = new ReportShopIceCreamViewModel
|
||||||
|
{
|
||||||
|
ShopName = shop.ShopName,
|
||||||
|
IceCreams = new List<(string IceCream, int Count)>(),
|
||||||
|
TotalCount = 0,
|
||||||
|
};
|
||||||
|
foreach (var iceCream in shop.ShopIceCreams)
|
||||||
|
{
|
||||||
|
record.IceCreams.Add(new(iceCream.Value.Item1.IceCreamName, iceCream.Value.Item2));
|
||||||
|
record.TotalCount += iceCream.Value.Item2;
|
||||||
|
}
|
||||||
|
|
||||||
|
list.Add(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
public List<ReportOrdersViewModel> GetOrders(ReportBindingModel model)
|
public List<ReportOrdersViewModel> GetOrders(ReportBindingModel model)
|
||||||
{
|
{
|
||||||
return _orderStorage.GetFilteredList(new OrderSearchModel { DateFrom = model.DateFrom, DateTo = model.DateTo })
|
return _orderStorage.GetFilteredList(new OrderSearchModel { DateFrom = model.DateFrom, DateTo = model.DateTo })
|
||||||
@ -72,6 +100,18 @@ namespace IceCreamShopBusinessLogic.BusinessLogics
|
|||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ReportOrdersByDateViewModel> GetGroupedByDateOrders()
|
||||||
|
{
|
||||||
|
return _orderStorage.GetFullList().GroupBy(x => x.DateCreate.Date)
|
||||||
|
.Select(x => new ReportOrdersByDateViewModel
|
||||||
|
{
|
||||||
|
Date = x.Key,
|
||||||
|
Count = x.Count(),
|
||||||
|
Sum = x.Sum(y => y.Sum)
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
public void SaveIceCreamsToWordFile(ReportBindingModel model)
|
public void SaveIceCreamsToWordFile(ReportBindingModel model)
|
||||||
{
|
{
|
||||||
_saveToWord.CreateDoc(new WordInfo
|
_saveToWord.CreateDoc(new WordInfo
|
||||||
@ -82,6 +122,16 @@ namespace IceCreamShopBusinessLogic.BusinessLogics
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SaveShopsToWordFile(ReportBindingModel model)
|
||||||
|
{
|
||||||
|
_saveToWord.CreateShopsTable(new WordInfo
|
||||||
|
{
|
||||||
|
FileName = model.FileName,
|
||||||
|
Title = "Список магазинов",
|
||||||
|
Shops = _shopStorage.GetFullList()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void SaveIceCreamComponentToExcelFile(ReportBindingModel model)
|
public void SaveIceCreamComponentToExcelFile(ReportBindingModel model)
|
||||||
{
|
{
|
||||||
_saveToExcel.CreateReport(new ExcelInfo
|
_saveToExcel.CreateReport(new ExcelInfo
|
||||||
@ -92,6 +142,16 @@ namespace IceCreamShopBusinessLogic.BusinessLogics
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SaveShopIceCreamToExcelFile(ReportBindingModel model)
|
||||||
|
{
|
||||||
|
_saveToExcel.CreateShopReport(new ExcelInfo
|
||||||
|
{
|
||||||
|
FileName = model.FileName,
|
||||||
|
Title = "Загруженность магазинов",
|
||||||
|
ShopIceCreams = GetShopIceCreams()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void SaveOrdersToPdfFile(ReportBindingModel model)
|
public void SaveOrdersToPdfFile(ReportBindingModel model)
|
||||||
{
|
{
|
||||||
_saveToPdf.CreateDoc(new PdfInfo
|
_saveToPdf.CreateDoc(new PdfInfo
|
||||||
@ -103,5 +163,15 @@ namespace IceCreamShopBusinessLogic.BusinessLogics
|
|||||||
Orders = GetOrders(model)
|
Orders = GetOrders(model)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SaveGroupedOrdersToPdfFile(ReportBindingModel model)
|
||||||
|
{
|
||||||
|
_saveToPdf.CreateDocWithGroupedOrders(new PdfInfo
|
||||||
|
{
|
||||||
|
FileName = model.FileName,
|
||||||
|
Title = "Заказы по датам",
|
||||||
|
GroupedOrders = GetGroupedByDateOrders()
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -79,11 +79,82 @@ namespace IceCreamShopBusinessLogic.OfficePackage
|
|||||||
SaveExcel(info);
|
SaveExcel(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
public void CreateShopReport(ExcelInfo info)
|
||||||
/// Создание excel-файла
|
{
|
||||||
/// </summary>
|
CreateExcel(info);
|
||||||
/// <param name="info"></param>
|
|
||||||
protected abstract void CreateExcel(ExcelInfo info);
|
InsertCellInWorksheet(new ExcelCellParameters
|
||||||
|
{
|
||||||
|
ColumnName = "A",
|
||||||
|
RowIndex = 1,
|
||||||
|
Text = info.Title,
|
||||||
|
StyleInfo = ExcelStyleInfoType.Title
|
||||||
|
});
|
||||||
|
|
||||||
|
MergeCells(new ExcelMergeParameters
|
||||||
|
{
|
||||||
|
CellFromName = "A1",
|
||||||
|
CellToName = "C1"
|
||||||
|
});
|
||||||
|
|
||||||
|
uint rowIndex = 2;
|
||||||
|
foreach (var si in info.ShopIceCreams)
|
||||||
|
{
|
||||||
|
InsertCellInWorksheet(new ExcelCellParameters
|
||||||
|
{
|
||||||
|
ColumnName = "A",
|
||||||
|
RowIndex = rowIndex,
|
||||||
|
Text = si.ShopName,
|
||||||
|
StyleInfo = ExcelStyleInfoType.Text
|
||||||
|
});
|
||||||
|
rowIndex++;
|
||||||
|
|
||||||
|
foreach (var (IceCream, Count) in si.IceCreams)
|
||||||
|
{
|
||||||
|
InsertCellInWorksheet(new ExcelCellParameters
|
||||||
|
{
|
||||||
|
ColumnName = "B",
|
||||||
|
RowIndex = rowIndex,
|
||||||
|
Text = IceCream,
|
||||||
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
||||||
|
});
|
||||||
|
|
||||||
|
InsertCellInWorksheet(new ExcelCellParameters
|
||||||
|
{
|
||||||
|
ColumnName = "C",
|
||||||
|
RowIndex = rowIndex,
|
||||||
|
Text = Count.ToString(),
|
||||||
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
||||||
|
});
|
||||||
|
|
||||||
|
rowIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
InsertCellInWorksheet(new ExcelCellParameters
|
||||||
|
{
|
||||||
|
ColumnName = "A",
|
||||||
|
RowIndex = rowIndex,
|
||||||
|
Text = "Итого",
|
||||||
|
StyleInfo = ExcelStyleInfoType.Text
|
||||||
|
});
|
||||||
|
InsertCellInWorksheet(new ExcelCellParameters
|
||||||
|
{
|
||||||
|
ColumnName = "C",
|
||||||
|
RowIndex = rowIndex,
|
||||||
|
Text = si.TotalCount.ToString(),
|
||||||
|
StyleInfo = ExcelStyleInfoType.Text
|
||||||
|
});
|
||||||
|
rowIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveExcel(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Создание excel-файла
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="info"></param>
|
||||||
|
protected abstract void CreateExcel(ExcelInfo info);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Добавляем новую ячейку в лист
|
/// Добавляем новую ячейку в лист
|
||||||
|
@ -36,6 +36,34 @@ namespace IceCreamShopBusinessLogic.OfficePackage
|
|||||||
SavePdf(info);
|
SavePdf(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CreateDocWithGroupedOrders(PdfInfo info)
|
||||||
|
{
|
||||||
|
CreatePdf(info);
|
||||||
|
CreateParagraph(new PdfParagraph { Text = info.Title, Style = "NormalTitle", ParagraphAlignment = PdfParagraphAlignmentType.Center });
|
||||||
|
|
||||||
|
CreateTable(new List<string> { "3cm", "4cm", "3cm" });
|
||||||
|
|
||||||
|
CreateRow(new PdfRowParameters
|
||||||
|
{
|
||||||
|
Texts = new List<string> { "Дата", "Количество заказов", "Сумма" },
|
||||||
|
Style = "NormalTitle",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var order in info.GroupedOrders)
|
||||||
|
{
|
||||||
|
CreateRow(new PdfRowParameters
|
||||||
|
{
|
||||||
|
Texts = new List<string> { order.Date.ToShortDateString(), order.Count.ToString(), order.Sum.ToString() },
|
||||||
|
Style = "Normal",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||||
|
});
|
||||||
|
}
|
||||||
|
CreateParagraph(new PdfParagraph { Text = $"Итого: {info.GroupedOrders.Sum(x => x.Sum)}\t", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Right });
|
||||||
|
|
||||||
|
SavePdf(info);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Создание pdf-файла
|
/// Создание pdf-файла
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -36,6 +36,51 @@ namespace IceCreamShopBusinessLogic.OfficePackage
|
|||||||
SaveWord(info);
|
SaveWord(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CreateShopsTable(WordInfo info)
|
||||||
|
{
|
||||||
|
CreateWord(info);
|
||||||
|
|
||||||
|
CreateParagraph(new WordParagraph
|
||||||
|
{
|
||||||
|
Texts = new List<(string, WordTextProperties)> { (info.Title, new WordTextProperties { Bold = true, Size = "24", }) },
|
||||||
|
TextProperties = new WordTextProperties
|
||||||
|
{
|
||||||
|
Size = "24",
|
||||||
|
JustificationType = WordJustificationType.Center
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
CreateTable(new List<string> { "3000", "3000", "3000" });
|
||||||
|
|
||||||
|
CreateRow(new WordParagraph
|
||||||
|
{
|
||||||
|
Texts = new List<(string, WordTextProperties)> { ("Название магазина", new WordTextProperties { Size = "24" }),
|
||||||
|
("Адрес", new WordTextProperties { Size = "24" }), ("Дата открытия", new WordTextProperties { Size = "24" }) },
|
||||||
|
TextProperties = new WordTextProperties
|
||||||
|
{
|
||||||
|
Size = "24",
|
||||||
|
Bold = true,
|
||||||
|
JustificationType = WordJustificationType.Center
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var shop in info.Shops)
|
||||||
|
{
|
||||||
|
CreateRow(new WordParagraph
|
||||||
|
{
|
||||||
|
Texts = new List<(string, WordTextProperties)> { (shop.ShopName, new WordTextProperties { Size = "22" }),
|
||||||
|
(shop.Address, new WordTextProperties { Size = "22" }), (shop.DateOpening.ToString(), new WordTextProperties { Size = "22" })},
|
||||||
|
TextProperties = new WordTextProperties
|
||||||
|
{
|
||||||
|
Size = "22",
|
||||||
|
JustificationType = WordJustificationType.Both
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveWord(info);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Создание doc-файла
|
/// Создание doc-файла
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -49,6 +94,18 @@ namespace IceCreamShopBusinessLogic.OfficePackage
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected abstract void CreateParagraph(WordParagraph paragraph);
|
protected abstract void CreateParagraph(WordParagraph paragraph);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Создание таблицы
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="columns"></param>
|
||||||
|
protected abstract void CreateTable(List<string> columns);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Создание строки таблицы
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="columns"></param>
|
||||||
|
protected abstract void CreateRow(WordParagraph paragraph);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Сохранение файла
|
/// Сохранение файла
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -9,5 +9,7 @@ namespace IceCreamShopBusinessLogic.OfficePackage.HelperModels
|
|||||||
public string Title { get; set; } = string.Empty;
|
public string Title { get; set; } = string.Empty;
|
||||||
|
|
||||||
public List<ReportIceCreamComponentViewModel> IceCreamComponents { get; set; } = new();
|
public List<ReportIceCreamComponentViewModel> IceCreamComponents { get; set; } = new();
|
||||||
|
|
||||||
|
public List<ReportShopIceCreamViewModel> ShopIceCreams { get; set; } = new();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -13,5 +13,7 @@ namespace IceCreamShopBusinessLogic.OfficePackage.HelperModels
|
|||||||
public DateTime DateTo { get; set; }
|
public DateTime DateTo { get; set; }
|
||||||
|
|
||||||
public List<ReportOrdersViewModel> Orders { get; set; } = new();
|
public List<ReportOrdersViewModel> Orders { get; set; } = new();
|
||||||
|
|
||||||
|
public List<ReportOrdersByDateViewModel> GroupedOrders { get; set; } = new();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,5 +9,7 @@ namespace IceCreamShopBusinessLogic.OfficePackage.HelperModels
|
|||||||
public string Title { get; set; } = string.Empty;
|
public string Title { get; set; } = string.Empty;
|
||||||
|
|
||||||
public List<IceCreamViewModel> IceCreams { get; set; } = new();
|
public List<IceCreamViewModel> IceCreams { get; set; } = new();
|
||||||
|
|
||||||
|
public List<ShopViewModel> Shops { get; set; } = new();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,6 +3,7 @@ using IceCreamShopBusinessLogic.OfficePackage.HelperModels;
|
|||||||
using DocumentFormat.OpenXml;
|
using DocumentFormat.OpenXml;
|
||||||
using DocumentFormat.OpenXml.Packaging;
|
using DocumentFormat.OpenXml.Packaging;
|
||||||
using DocumentFormat.OpenXml.Wordprocessing;
|
using DocumentFormat.OpenXml.Wordprocessing;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
|
||||||
namespace IceCreamShopBusinessLogic.OfficePackage.Implements
|
namespace IceCreamShopBusinessLogic.OfficePackage.Implements
|
||||||
{
|
{
|
||||||
@ -12,6 +13,8 @@ namespace IceCreamShopBusinessLogic.OfficePackage.Implements
|
|||||||
|
|
||||||
private Body? _docBody;
|
private Body? _docBody;
|
||||||
|
|
||||||
|
private Table? table;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Получение типа выравнивания
|
/// Получение типа выравнивания
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -119,6 +122,67 @@ namespace IceCreamShopBusinessLogic.OfficePackage.Implements
|
|||||||
_docBody.AppendChild(docParagraph);
|
_docBody.AppendChild(docParagraph);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void CreateTable(List<string> columns)
|
||||||
|
{
|
||||||
|
if (_docBody == null || columns == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
table = new();
|
||||||
|
TableProperties properties = new();
|
||||||
|
properties.AppendChild(new TableLayout { Type = TableLayoutValues.Fixed });
|
||||||
|
properties.AppendChild(new TableBorders(
|
||||||
|
new TopBorder() { Val = new EnumValue<BorderValues>(BorderValues.Single), Size = 4 },
|
||||||
|
new LeftBorder() { Val = new EnumValue<BorderValues>(BorderValues.Single), Size = 4 },
|
||||||
|
new RightBorder() { Val = new EnumValue<BorderValues>(BorderValues.Single), Size = 4 },
|
||||||
|
new BottomBorder() { Val = new EnumValue<BorderValues>(BorderValues.Single), Size = 4 },
|
||||||
|
new InsideHorizontalBorder() { Val = new EnumValue<BorderValues>(BorderValues.Single), Size = 4 },
|
||||||
|
new InsideVerticalBorder() { Val = new EnumValue<BorderValues>(BorderValues.Single), Size = 4 }
|
||||||
|
));
|
||||||
|
properties.AppendChild(new TableWidth { Type = TableWidthUnitValues.Auto });
|
||||||
|
table.AppendChild(properties);
|
||||||
|
|
||||||
|
TableGrid tableGrid = new();
|
||||||
|
foreach (var column in columns)
|
||||||
|
{
|
||||||
|
tableGrid.AppendChild(new GridColumn() { Width = column });
|
||||||
|
}
|
||||||
|
table.AppendChild(tableGrid);
|
||||||
|
|
||||||
|
_docBody.AppendChild(table);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void CreateRow(WordParagraph paragraph)
|
||||||
|
{
|
||||||
|
if (_docBody == null || table == null || paragraph == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
TableRow tableRow = new();
|
||||||
|
foreach (var column in paragraph.Texts)
|
||||||
|
{
|
||||||
|
var tableParagraph = new Paragraph();
|
||||||
|
tableParagraph.AppendChild(CreateParagraphProperties(paragraph.TextProperties));
|
||||||
|
|
||||||
|
var tableRun = new Run();
|
||||||
|
var runProperties = new RunProperties();
|
||||||
|
runProperties.AppendChild(new FontSize { Val = column.Item2.Size });
|
||||||
|
if (column.Item2.Bold)
|
||||||
|
{
|
||||||
|
runProperties.AppendChild(new Bold());
|
||||||
|
}
|
||||||
|
tableRun.AppendChild(runProperties);
|
||||||
|
tableRun.AppendChild(new Text { Text = column.Item1, Space = SpaceProcessingModeValues.Preserve });
|
||||||
|
tableParagraph.AppendChild(tableRun);
|
||||||
|
|
||||||
|
TableCell cell = new();
|
||||||
|
cell.AppendChild(tableParagraph);
|
||||||
|
tableRow.AppendChild(cell);
|
||||||
|
}
|
||||||
|
table.AppendChild(tableRow);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void SaveWord(WordInfo info)
|
protected override void SaveWord(WordInfo info)
|
||||||
{
|
{
|
||||||
if (_docBody == null || _wordDocument == null)
|
if (_docBody == null || _wordDocument == null)
|
||||||
|
@ -7,12 +7,22 @@ namespace IceCreamShopContracts.BusinessLogicsContracts
|
|||||||
{
|
{
|
||||||
List<ReportIceCreamComponentViewModel> GetIceCreamComponents();
|
List<ReportIceCreamComponentViewModel> GetIceCreamComponents();
|
||||||
|
|
||||||
|
List<ReportShopIceCreamViewModel> GetShopIceCreams();
|
||||||
|
|
||||||
List<ReportOrdersViewModel> GetOrders(ReportBindingModel model);
|
List<ReportOrdersViewModel> GetOrders(ReportBindingModel model);
|
||||||
|
|
||||||
|
List<ReportOrdersByDateViewModel> GetGroupedByDateOrders();
|
||||||
|
|
||||||
void SaveIceCreamsToWordFile(ReportBindingModel model);
|
void SaveIceCreamsToWordFile(ReportBindingModel model);
|
||||||
|
|
||||||
|
void SaveShopsToWordFile(ReportBindingModel model);
|
||||||
|
|
||||||
void SaveIceCreamComponentToExcelFile(ReportBindingModel model);
|
void SaveIceCreamComponentToExcelFile(ReportBindingModel model);
|
||||||
|
|
||||||
|
void SaveShopIceCreamToExcelFile(ReportBindingModel model);
|
||||||
|
|
||||||
void SaveOrdersToPdfFile(ReportBindingModel model);
|
void SaveOrdersToPdfFile(ReportBindingModel model);
|
||||||
|
|
||||||
|
void SaveGroupedOrdersToPdfFile(ReportBindingModel model);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
namespace IceCreamShopContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class ReportOrdersByDateViewModel
|
||||||
|
{
|
||||||
|
public DateTime Date { get; set; }
|
||||||
|
|
||||||
|
public int Count { get; set; }
|
||||||
|
|
||||||
|
public double Sum { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
namespace IceCreamShopContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class ReportShopIceCreamViewModel
|
||||||
|
{
|
||||||
|
public string ShopName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public int TotalCount { get; set; }
|
||||||
|
|
||||||
|
public List<(string IceCream, int Count)> IceCreams { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
@ -81,7 +81,7 @@ namespace IceCreamShopView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void продажаМороженогоToolStripMenuItem_Click(object sender, EventArgs e)
|
private void ПродажаМороженогоToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormIceCreamSale));
|
var service = Program.ServiceProvider?.GetService(typeof(FormIceCreamSale));
|
||||||
if (service is FormIceCreamSale form)
|
if (service is FormIceCreamSale form)
|
||||||
@ -118,6 +118,34 @@ namespace IceCreamShopView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void СписокМагазиновToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
|
||||||
|
if (dialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
_reportLogic.SaveShopsToWordFile(new ReportBindingModel { FileName = dialog.FileName });
|
||||||
|
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ЗагруженностьМагазиновToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var service = Program.ServiceProvider?.GetService(typeof(FormReportShopIceCreams));
|
||||||
|
if (service is FormReportShopIceCreams form)
|
||||||
|
{
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ЗаказыПоДатамToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupedOrders));
|
||||||
|
if (service is FormReportGroupedOrders form)
|
||||||
|
{
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ButtonCreateOrder_Click(object sender, EventArgs e)
|
private void ButtonCreateOrder_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder));
|
var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder));
|
||||||
|
64
IceCreamShop/IceCreamShopView/FormMain.designer.cs
generated
64
IceCreamShop/IceCreamShopView/FormMain.designer.cs
generated
@ -33,26 +33,28 @@
|
|||||||
компонентыToolStripMenuItem = new ToolStripMenuItem();
|
компонентыToolStripMenuItem = new ToolStripMenuItem();
|
||||||
мороженоеToolStripMenuItem = new ToolStripMenuItem();
|
мороженоеToolStripMenuItem = new ToolStripMenuItem();
|
||||||
магазиныToolStripMenuItem = new ToolStripMenuItem();
|
магазиныToolStripMenuItem = new ToolStripMenuItem();
|
||||||
пополнениеМагазинаToolStripMenuItem = new ToolStripMenuItem();
|
|
||||||
отчетыToolStripMenuItem = new ToolStripMenuItem();
|
отчетыToolStripMenuItem = new ToolStripMenuItem();
|
||||||
списокМороженогоToolStripMenuItem = new ToolStripMenuItem();
|
списокМороженогоToolStripMenuItem = new ToolStripMenuItem();
|
||||||
компонентыПоМороженымToolStripMenuItem = new ToolStripMenuItem();
|
компонентыПоМороженымToolStripMenuItem = new ToolStripMenuItem();
|
||||||
списокЗаказовToolStripMenuItem = new ToolStripMenuItem();
|
списокЗаказовToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
списокМагазиновToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
загруженностьМагазиновToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
заказыПоДатамToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
пополнениеМагазинаToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
продажаМороженогоToolStripMenuItem = new ToolStripMenuItem();
|
||||||
buttonIssuedOrder = new Button();
|
buttonIssuedOrder = new Button();
|
||||||
buttonOrderReady = new Button();
|
buttonOrderReady = new Button();
|
||||||
buttonTakeOrderInWork = new Button();
|
buttonTakeOrderInWork = new Button();
|
||||||
buttonCreateOrder = new Button();
|
buttonCreateOrder = new Button();
|
||||||
dataGridView = new DataGridView();
|
dataGridView = new DataGridView();
|
||||||
buttonUpd = new Button();
|
buttonUpd = new Button();
|
||||||
продажаМороженогоToolStripMenuItem = new ToolStripMenuItem();
|
|
||||||
menuStrip.SuspendLayout();
|
menuStrip.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// menuStrip
|
// menuStrip
|
||||||
//
|
//
|
||||||
menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, пополнениеМагазинаToolStripMenuItem, продажаМороженогоToolStripMenuItem });
|
menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, отчетыToolStripMenuItem, пополнениеМагазинаToolStripMenuItem, продажаМороженогоToolStripMenuItem });
|
||||||
menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, отчетыToolStripMenuItem });
|
|
||||||
menuStrip.Location = new Point(0, 0);
|
menuStrip.Location = new Point(0, 0);
|
||||||
menuStrip.Name = "menuStrip";
|
menuStrip.Name = "menuStrip";
|
||||||
menuStrip.Padding = new Padding(7, 2, 0, 2);
|
menuStrip.Padding = new Padding(7, 2, 0, 2);
|
||||||
@ -88,16 +90,9 @@
|
|||||||
магазиныToolStripMenuItem.Text = "Магазины";
|
магазиныToolStripMenuItem.Text = "Магазины";
|
||||||
магазиныToolStripMenuItem.Click += МагазиныToolStripMenuItem_Click;
|
магазиныToolStripMenuItem.Click += МагазиныToolStripMenuItem_Click;
|
||||||
//
|
//
|
||||||
// пополнениеМагазинаToolStripMenuItem
|
|
||||||
//
|
|
||||||
пополнениеМагазинаToolStripMenuItem.Name = "пополнениеМагазинаToolStripMenuItem";
|
|
||||||
пополнениеМагазинаToolStripMenuItem.Size = new Size(143, 20);
|
|
||||||
пополнениеМагазинаToolStripMenuItem.Text = "Пополнение магазина";
|
|
||||||
пополнениеМагазинаToolStripMenuItem.Click += ПополнениеМагазинаToolStripMenuItem_Click;
|
|
||||||
//
|
|
||||||
// отчетыToolStripMenuItem
|
// отчетыToolStripMenuItem
|
||||||
//
|
//
|
||||||
отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокМороженогоToolStripMenuItem, компонентыПоМороженымToolStripMenuItem, списокЗаказовToolStripMenuItem });
|
отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокМороженогоToolStripMenuItem, компонентыПоМороженымToolStripMenuItem, списокЗаказовToolStripMenuItem, списокМагазиновToolStripMenuItem, загруженностьМагазиновToolStripMenuItem, заказыПоДатамToolStripMenuItem });
|
||||||
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
|
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
|
||||||
отчетыToolStripMenuItem.Size = new Size(60, 20);
|
отчетыToolStripMenuItem.Size = new Size(60, 20);
|
||||||
отчетыToolStripMenuItem.Text = "Отчеты";
|
отчетыToolStripMenuItem.Text = "Отчеты";
|
||||||
@ -123,6 +118,41 @@
|
|||||||
списокЗаказовToolStripMenuItem.Text = "Список заказов";
|
списокЗаказовToolStripMenuItem.Text = "Список заказов";
|
||||||
списокЗаказовToolStripMenuItem.Click += СписокЗаказовToolStripMenuItem_Click;
|
списокЗаказовToolStripMenuItem.Click += СписокЗаказовToolStripMenuItem_Click;
|
||||||
//
|
//
|
||||||
|
// списокМагазиновToolStripMenuItem
|
||||||
|
//
|
||||||
|
списокМагазиновToolStripMenuItem.Name = "списокМагазиновToolStripMenuItem";
|
||||||
|
списокМагазиновToolStripMenuItem.Size = new Size(235, 22);
|
||||||
|
списокМагазиновToolStripMenuItem.Text = "Список магазинов";
|
||||||
|
списокМагазиновToolStripMenuItem.Click += СписокМагазиновToolStripMenuItem_Click;
|
||||||
|
//
|
||||||
|
// загруженностьМагазиновToolStripMenuItem
|
||||||
|
//
|
||||||
|
загруженностьМагазиновToolStripMenuItem.Name = "загруженностьМагазиновToolStripMenuItem";
|
||||||
|
загруженностьМагазиновToolStripMenuItem.Size = new Size(235, 22);
|
||||||
|
загруженностьМагазиновToolStripMenuItem.Text = "Загруженность магазинов";
|
||||||
|
загруженностьМагазиновToolStripMenuItem.Click += ЗагруженностьМагазиновToolStripMenuItem_Click;
|
||||||
|
//
|
||||||
|
// заказыПоДатамToolStripMenuItem
|
||||||
|
//
|
||||||
|
заказыПоДатамToolStripMenuItem.Name = "заказыПоДатамToolStripMenuItem";
|
||||||
|
заказыПоДатамToolStripMenuItem.Size = new Size(235, 22);
|
||||||
|
заказыПоДатамToolStripMenuItem.Text = "Заказы по датам";
|
||||||
|
заказыПоДатамToolStripMenuItem.Click += ЗаказыПоДатамToolStripMenuItem_Click;
|
||||||
|
//
|
||||||
|
// пополнениеМагазинаToolStripMenuItem
|
||||||
|
//
|
||||||
|
пополнениеМагазинаToolStripMenuItem.Name = "пополнениеМагазинаToolStripMenuItem";
|
||||||
|
пополнениеМагазинаToolStripMenuItem.Size = new Size(143, 20);
|
||||||
|
пополнениеМагазинаToolStripMenuItem.Text = "Пополнение магазина";
|
||||||
|
пополнениеМагазинаToolStripMenuItem.Click += ПополнениеМагазинаToolStripMenuItem_Click;
|
||||||
|
//
|
||||||
|
// продажаМороженогоToolStripMenuItem
|
||||||
|
//
|
||||||
|
продажаМороженогоToolStripMenuItem.Name = "продажаМороженогоToolStripMenuItem";
|
||||||
|
продажаМороженогоToolStripMenuItem.Size = new Size(143, 20);
|
||||||
|
продажаМороженогоToolStripMenuItem.Text = "Продажа мороженого";
|
||||||
|
продажаМороженогоToolStripMenuItem.Click += ПродажаМороженогоToolStripMenuItem_Click;
|
||||||
|
//
|
||||||
// buttonIssuedOrder
|
// buttonIssuedOrder
|
||||||
//
|
//
|
||||||
buttonIssuedOrder.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
buttonIssuedOrder.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
@ -200,13 +230,6 @@
|
|||||||
buttonUpd.UseVisualStyleBackColor = true;
|
buttonUpd.UseVisualStyleBackColor = true;
|
||||||
buttonUpd.Click += ButtonUpd_Click;
|
buttonUpd.Click += ButtonUpd_Click;
|
||||||
//
|
//
|
||||||
// продажаМороженогоToolStripMenuItem
|
|
||||||
//
|
|
||||||
продажаМороженогоToolStripMenuItem.Name = "продажаМороженогоToolStripMenuItem";
|
|
||||||
продажаМороженогоToolStripMenuItem.Size = new Size(143, 20);
|
|
||||||
продажаМороженогоToolStripMenuItem.Text = "Продажа мороженого";
|
|
||||||
продажаМороженогоToolStripMenuItem.Click += продажаМороженогоToolStripMenuItem_Click;
|
|
||||||
//
|
|
||||||
// FormMain
|
// FormMain
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
@ -251,6 +274,9 @@
|
|||||||
private ToolStripMenuItem списокМороженогоToolStripMenuItem;
|
private ToolStripMenuItem списокМороженогоToolStripMenuItem;
|
||||||
private ToolStripMenuItem компонентыПоМороженымToolStripMenuItem;
|
private ToolStripMenuItem компонентыПоМороженымToolStripMenuItem;
|
||||||
private ToolStripMenuItem списокЗаказовToolStripMenuItem;
|
private ToolStripMenuItem списокЗаказовToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem списокМагазиновToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem загруженностьМагазиновToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem заказыПоДатамToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
72
IceCreamShop/IceCreamShopView/FormReportGroupedOrders.cs
Normal file
72
IceCreamShop/IceCreamShopView/FormReportGroupedOrders.cs
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
using IceCreamShopContracts.BindingModels;
|
||||||
|
using IceCreamShopContracts.BusinessLogicsContracts;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.Reporting.WinForms;
|
||||||
|
|
||||||
|
namespace IceCreamShopView
|
||||||
|
{
|
||||||
|
public partial class FormReportGroupedOrders : Form
|
||||||
|
{
|
||||||
|
private readonly ReportViewer reportViewer;
|
||||||
|
|
||||||
|
private readonly ILogger _logger;
|
||||||
|
|
||||||
|
private readonly IReportLogic _logic;
|
||||||
|
|
||||||
|
public FormReportGroupedOrders(ILogger<FormReportOrders> logger, IReportLogic logic)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_logger = logger;
|
||||||
|
_logic = logic;
|
||||||
|
reportViewer = new ReportViewer
|
||||||
|
{
|
||||||
|
Dock = DockStyle.Fill
|
||||||
|
};
|
||||||
|
reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportGroupedOrders.rdlc", FileMode.Open));
|
||||||
|
Controls.Clear();
|
||||||
|
Controls.Add(reportViewer);
|
||||||
|
Controls.Add(panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonCreateReport_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var dataSource = _logic.GetGroupedByDateOrders();
|
||||||
|
var source = new ReportDataSource("DataSetOrders", dataSource);
|
||||||
|
reportViewer.LocalReport.DataSources.Clear();
|
||||||
|
reportViewer.LocalReport.DataSources.Add(source);
|
||||||
|
|
||||||
|
reportViewer.RefreshReport();
|
||||||
|
_logger.LogInformation("Loading list of grouped orders");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Loading list of grouped orders error");
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonToPdf_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
using var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" };
|
||||||
|
if (dialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_logic.SaveGroupedOrdersToPdfFile(new ReportBindingModel
|
||||||
|
{
|
||||||
|
FileName = dialog.FileName,
|
||||||
|
});
|
||||||
|
_logger.LogInformation("Saving list of grouped orders");
|
||||||
|
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Saving list of grouped orders error");
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
91
IceCreamShop/IceCreamShopView/FormReportGroupedOrders.designer.cs
generated
Normal file
91
IceCreamShop/IceCreamShopView/FormReportGroupedOrders.designer.cs
generated
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
namespace IceCreamShopView
|
||||||
|
{
|
||||||
|
partial class FormReportGroupedOrders
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
panel = new Panel();
|
||||||
|
buttonToPdf = new Button();
|
||||||
|
buttonCreateReport = new Button();
|
||||||
|
panel.SuspendLayout();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// panel
|
||||||
|
//
|
||||||
|
panel.Controls.Add(buttonToPdf);
|
||||||
|
panel.Controls.Add(buttonCreateReport);
|
||||||
|
panel.Dock = DockStyle.Top;
|
||||||
|
panel.Location = new Point(0, 0);
|
||||||
|
panel.Margin = new Padding(4, 3, 4, 3);
|
||||||
|
panel.Name = "panel";
|
||||||
|
panel.Size = new Size(1031, 40);
|
||||||
|
panel.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// buttonToPdf
|
||||||
|
//
|
||||||
|
buttonToPdf.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
|
buttonToPdf.Location = new Point(188, 8);
|
||||||
|
buttonToPdf.Margin = new Padding(4, 3, 4, 3);
|
||||||
|
buttonToPdf.Name = "buttonToPdf";
|
||||||
|
buttonToPdf.Size = new Size(139, 27);
|
||||||
|
buttonToPdf.TabIndex = 5;
|
||||||
|
buttonToPdf.Text = "В Pdf";
|
||||||
|
buttonToPdf.UseVisualStyleBackColor = true;
|
||||||
|
buttonToPdf.Click += ButtonToPdf_Click;
|
||||||
|
//
|
||||||
|
// buttonCreateReport
|
||||||
|
//
|
||||||
|
buttonCreateReport.Location = new Point(11, 8);
|
||||||
|
buttonCreateReport.Margin = new Padding(4, 3, 4, 3);
|
||||||
|
buttonCreateReport.Name = "buttonCreateReport";
|
||||||
|
buttonCreateReport.Size = new Size(139, 27);
|
||||||
|
buttonCreateReport.TabIndex = 4;
|
||||||
|
buttonCreateReport.Text = "Сформировать";
|
||||||
|
buttonCreateReport.UseVisualStyleBackColor = true;
|
||||||
|
buttonCreateReport.Click += ButtonCreateReport_Click;
|
||||||
|
//
|
||||||
|
// FormReportGroupedOrders
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(1031, 647);
|
||||||
|
Controls.Add(panel);
|
||||||
|
Margin = new Padding(4, 3, 4, 3);
|
||||||
|
Name = "FormReportGroupedOrders";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Заказы по датам";
|
||||||
|
panel.ResumeLayout(false);
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Panel panel;
|
||||||
|
private System.Windows.Forms.Button buttonToPdf;
|
||||||
|
private System.Windows.Forms.Button buttonCreateReport;
|
||||||
|
}
|
||||||
|
}
|
120
IceCreamShop/IceCreamShopView/FormReportGroupedOrders.resx
Normal file
120
IceCreamShop/IceCreamShopView/FormReportGroupedOrders.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
70
IceCreamShop/IceCreamShopView/FormReportShopIceCreams.cs
Normal file
70
IceCreamShop/IceCreamShopView/FormReportShopIceCreams.cs
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
using IceCreamShopContracts.BindingModels;
|
||||||
|
using IceCreamShopContracts.BusinessLogicsContracts;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace IceCreamShopView
|
||||||
|
{
|
||||||
|
public partial class FormReportShopIceCreams : Form
|
||||||
|
{
|
||||||
|
private readonly ILogger _logger;
|
||||||
|
|
||||||
|
private readonly IReportLogic _logic;
|
||||||
|
|
||||||
|
public FormReportShopIceCreams(ILogger<FormReportIceCreamComponents> logger, IReportLogic logic)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_logger = logger;
|
||||||
|
_logic = logic;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FormReportShopIceCreams_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var dict = _logic.GetShopIceCreams();
|
||||||
|
if (dict != null)
|
||||||
|
{
|
||||||
|
dataGridView.Rows.Clear();
|
||||||
|
foreach (var elem in dict)
|
||||||
|
{
|
||||||
|
dataGridView.Rows.Add(new object[] { elem.ShopName, "", "" });
|
||||||
|
foreach (var listElem in elem.IceCreams)
|
||||||
|
{
|
||||||
|
dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 });
|
||||||
|
}
|
||||||
|
dataGridView.Rows.Add(new object[] { "Итого", "", elem.TotalCount });
|
||||||
|
dataGridView.Rows.Add(Array.Empty<object>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_logger.LogInformation("Loading information on store workload");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Loading information on store workload error");
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonSaveToExcel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
using var dialog = new SaveFileDialog { Filter = "xlsx|*.xlsx" };
|
||||||
|
if (dialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_logic.SaveShopIceCreamToExcelFile(new ReportBindingModel
|
||||||
|
{
|
||||||
|
FileName = dialog.FileName
|
||||||
|
});
|
||||||
|
_logger.LogInformation("Saving information on store workload");
|
||||||
|
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Saving information on store workload error");
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
114
IceCreamShop/IceCreamShopView/FormReportShopIceCreams.designer.cs
generated
Normal file
114
IceCreamShop/IceCreamShopView/FormReportShopIceCreams.designer.cs
generated
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
namespace IceCreamShopView
|
||||||
|
{
|
||||||
|
partial class FormReportShopIceCreams
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
dataGridView = new DataGridView();
|
||||||
|
buttonSaveToExcel = new Button();
|
||||||
|
ColumnShop = new DataGridViewTextBoxColumn();
|
||||||
|
ColumnIceCream = new DataGridViewTextBoxColumn();
|
||||||
|
ColumnCount = new DataGridViewTextBoxColumn();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// dataGridView
|
||||||
|
//
|
||||||
|
dataGridView.AllowUserToAddRows = false;
|
||||||
|
dataGridView.AllowUserToDeleteRows = false;
|
||||||
|
dataGridView.AllowUserToOrderColumns = true;
|
||||||
|
dataGridView.AllowUserToResizeColumns = false;
|
||||||
|
dataGridView.AllowUserToResizeRows = false;
|
||||||
|
dataGridView.BackgroundColor = SystemColors.ControlLightLight;
|
||||||
|
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dataGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnShop, ColumnIceCream, ColumnCount });
|
||||||
|
dataGridView.Dock = DockStyle.Bottom;
|
||||||
|
dataGridView.Location = new Point(0, 47);
|
||||||
|
dataGridView.Margin = new Padding(4, 3, 4, 3);
|
||||||
|
dataGridView.MultiSelect = false;
|
||||||
|
dataGridView.Name = "dataGridView";
|
||||||
|
dataGridView.ReadOnly = true;
|
||||||
|
dataGridView.RowHeadersVisible = false;
|
||||||
|
dataGridView.Size = new Size(616, 510);
|
||||||
|
dataGridView.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// buttonSaveToExcel
|
||||||
|
//
|
||||||
|
buttonSaveToExcel.Location = new Point(13, 10);
|
||||||
|
buttonSaveToExcel.Margin = new Padding(4, 3, 4, 3);
|
||||||
|
buttonSaveToExcel.Name = "buttonSaveToExcel";
|
||||||
|
buttonSaveToExcel.Size = new Size(186, 27);
|
||||||
|
buttonSaveToExcel.TabIndex = 1;
|
||||||
|
buttonSaveToExcel.Text = "Сохранить в Excel";
|
||||||
|
buttonSaveToExcel.UseVisualStyleBackColor = true;
|
||||||
|
buttonSaveToExcel.Click += ButtonSaveToExcel_Click;
|
||||||
|
//
|
||||||
|
// ColumnShop
|
||||||
|
//
|
||||||
|
ColumnShop.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||||
|
ColumnShop.HeaderText = "Магазин";
|
||||||
|
ColumnShop.Name = "ColumnShop";
|
||||||
|
ColumnShop.ReadOnly = true;
|
||||||
|
//
|
||||||
|
// ColumnIceCream
|
||||||
|
//
|
||||||
|
ColumnIceCream.HeaderText = "Мороженое";
|
||||||
|
ColumnIceCream.Name = "ColumnIceCream";
|
||||||
|
ColumnIceCream.ReadOnly = true;
|
||||||
|
ColumnIceCream.Width = 200;
|
||||||
|
//
|
||||||
|
// ColumnCount
|
||||||
|
//
|
||||||
|
ColumnCount.HeaderText = "Количество";
|
||||||
|
ColumnCount.Name = "ColumnCount";
|
||||||
|
ColumnCount.ReadOnly = true;
|
||||||
|
//
|
||||||
|
// FormReportShopIceCreams
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(616, 557);
|
||||||
|
Controls.Add(buttonSaveToExcel);
|
||||||
|
Controls.Add(dataGridView);
|
||||||
|
Margin = new Padding(4, 3, 4, 3);
|
||||||
|
Name = "FormReportShopIceCreams";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Загруженность магазинов";
|
||||||
|
Load += FormReportShopIceCreams_Load;
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.DataGridView dataGridView;
|
||||||
|
private System.Windows.Forms.Button buttonSaveToExcel;
|
||||||
|
private DataGridViewTextBoxColumn ColumnShop;
|
||||||
|
private DataGridViewTextBoxColumn ColumnIceCream;
|
||||||
|
private DataGridViewTextBoxColumn ColumnCount;
|
||||||
|
}
|
||||||
|
}
|
120
IceCreamShop/IceCreamShopView/FormReportShopIceCreams.resx
Normal file
120
IceCreamShop/IceCreamShopView/FormReportShopIceCreams.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
@ -37,4 +37,22 @@
|
|||||||
<ProjectReference Include="..\IceCreamShopListImplement\IceCreamShopListImplement.csproj" />
|
<ProjectReference Include="..\IceCreamShopListImplement\IceCreamShopListImplement.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Update="FormReportGroupedOrders.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="FormReportShopIceCreams.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="ReportGroupedOrders.rdlc">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="ReportOrders.rdlc">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
@ -65,6 +65,8 @@ namespace IceCreamShopView
|
|||||||
services.AddTransient<FormIceCreamSale>();
|
services.AddTransient<FormIceCreamSale>();
|
||||||
services.AddTransient<FormReportIceCreamComponents>();
|
services.AddTransient<FormReportIceCreamComponents>();
|
||||||
services.AddTransient<FormReportOrders>();
|
services.AddTransient<FormReportOrders>();
|
||||||
|
services.AddTransient<FormReportShopIceCreams>();
|
||||||
|
services.AddTransient<FormReportGroupedOrders>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
424
IceCreamShop/IceCreamShopView/ReportGroupedOrders.rdlc
Normal file
424
IceCreamShop/IceCreamShopView/ReportGroupedOrders.rdlc
Normal file
@ -0,0 +1,424 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
|
||||||
|
<AutoRefresh>0</AutoRefresh>
|
||||||
|
<DataSources>
|
||||||
|
<DataSource Name="IceCreamShopContractsViewModels">
|
||||||
|
<ConnectionProperties>
|
||||||
|
<DataProvider>System.Data.DataSet</DataProvider>
|
||||||
|
<ConnectString>/* Local Connection */</ConnectString>
|
||||||
|
</ConnectionProperties>
|
||||||
|
<rd:DataSourceID>10791c83-cee8-4a38-bbd0-245fc17cefb3</rd:DataSourceID>
|
||||||
|
</DataSource>
|
||||||
|
</DataSources>
|
||||||
|
<DataSets>
|
||||||
|
<DataSet Name="DataSetOrders">
|
||||||
|
<Query>
|
||||||
|
<DataSourceName>IceCreamShopContractsViewModels</DataSourceName>
|
||||||
|
<CommandText>/* Local Query */</CommandText>
|
||||||
|
</Query>
|
||||||
|
<Fields>
|
||||||
|
<Field Name="Date">
|
||||||
|
<DataField>Date</DataField>
|
||||||
|
<rd:TypeName>System.DateTime</rd:TypeName>
|
||||||
|
</Field>
|
||||||
|
<Field Name="Count">
|
||||||
|
<DataField>Count</DataField>
|
||||||
|
<rd:TypeName>System.Int32</rd:TypeName>
|
||||||
|
</Field>
|
||||||
|
<Field Name="Sum">
|
||||||
|
<DataField>Sum</DataField>
|
||||||
|
<rd:TypeName>System.Decimal</rd:TypeName>
|
||||||
|
</Field>
|
||||||
|
</Fields>
|
||||||
|
<rd:DataSetInfo>
|
||||||
|
<rd:DataSetName>IceCreamShopContracts.ViewModels</rd:DataSetName>
|
||||||
|
<rd:TableName>ReportOrdersByDateViewModel</rd:TableName>
|
||||||
|
<rd:ObjectDataSourceType>IceCreamShopContracts.ViewModels.ReportOrdersByDateViewModel, IceCreamShopContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
|
||||||
|
</rd:DataSetInfo>
|
||||||
|
</DataSet>
|
||||||
|
</DataSets>
|
||||||
|
<ReportSections>
|
||||||
|
<ReportSection>
|
||||||
|
<Body>
|
||||||
|
<ReportItems>
|
||||||
|
<Textbox Name="TextboxTitle">
|
||||||
|
<CanGrow>true</CanGrow>
|
||||||
|
<KeepTogether>true</KeepTogether>
|
||||||
|
<Paragraphs>
|
||||||
|
<Paragraph>
|
||||||
|
<TextRuns>
|
||||||
|
<TextRun>
|
||||||
|
<Value>Заказы по датам</Value>
|
||||||
|
<Style>
|
||||||
|
<FontSize>16pt</FontSize>
|
||||||
|
<FontWeight>Bold</FontWeight>
|
||||||
|
</Style>
|
||||||
|
</TextRun>
|
||||||
|
</TextRuns>
|
||||||
|
<Style>
|
||||||
|
<TextAlign>Center</TextAlign>
|
||||||
|
</Style>
|
||||||
|
</Paragraph>
|
||||||
|
</Paragraphs>
|
||||||
|
<Height>1cm</Height>
|
||||||
|
<Width>21cm</Width>
|
||||||
|
<Style>
|
||||||
|
<Border>
|
||||||
|
<Style>None</Style>
|
||||||
|
</Border>
|
||||||
|
<VerticalAlign>Middle</VerticalAlign>
|
||||||
|
<PaddingLeft>2pt</PaddingLeft>
|
||||||
|
<PaddingRight>2pt</PaddingRight>
|
||||||
|
<PaddingTop>2pt</PaddingTop>
|
||||||
|
<PaddingBottom>2pt</PaddingBottom>
|
||||||
|
</Style>
|
||||||
|
</Textbox>
|
||||||
|
<Tablix Name="Tablix">
|
||||||
|
<TablixBody>
|
||||||
|
<TablixColumns>
|
||||||
|
<TablixColumn>
|
||||||
|
<Width>6.01401cm</Width>
|
||||||
|
</TablixColumn>
|
||||||
|
<TablixColumn>
|
||||||
|
<Width>6.56042cm</Width>
|
||||||
|
</TablixColumn>
|
||||||
|
<TablixColumn>
|
||||||
|
<Width>6.12687cm</Width>
|
||||||
|
</TablixColumn>
|
||||||
|
</TablixColumns>
|
||||||
|
<TablixRows>
|
||||||
|
<TablixRow>
|
||||||
|
<Height>0.6cm</Height>
|
||||||
|
<TablixCells>
|
||||||
|
<TablixCell>
|
||||||
|
<CellContents>
|
||||||
|
<Textbox Name="TextboxDate">
|
||||||
|
<CanGrow>true</CanGrow>
|
||||||
|
<KeepTogether>true</KeepTogether>
|
||||||
|
<Paragraphs>
|
||||||
|
<Paragraph>
|
||||||
|
<TextRuns>
|
||||||
|
<TextRun>
|
||||||
|
<Value>Дата</Value>
|
||||||
|
<Style>
|
||||||
|
<FontWeight>Bold</FontWeight>
|
||||||
|
</Style>
|
||||||
|
</TextRun>
|
||||||
|
</TextRuns>
|
||||||
|
<Style />
|
||||||
|
</Paragraph>
|
||||||
|
</Paragraphs>
|
||||||
|
<rd:DefaultName>TextboxDate</rd:DefaultName>
|
||||||
|
<Style>
|
||||||
|
<Border>
|
||||||
|
<Color>LightGrey</Color>
|
||||||
|
<Style>Solid</Style>
|
||||||
|
</Border>
|
||||||
|
<PaddingLeft>2pt</PaddingLeft>
|
||||||
|
<PaddingRight>2pt</PaddingRight>
|
||||||
|
<PaddingTop>2pt</PaddingTop>
|
||||||
|
<PaddingBottom>2pt</PaddingBottom>
|
||||||
|
</Style>
|
||||||
|
</Textbox>
|
||||||
|
</CellContents>
|
||||||
|
</TablixCell>
|
||||||
|
<TablixCell>
|
||||||
|
<CellContents>
|
||||||
|
<Textbox Name="TextboxCount">
|
||||||
|
<CanGrow>true</CanGrow>
|
||||||
|
<KeepTogether>true</KeepTogether>
|
||||||
|
<Paragraphs>
|
||||||
|
<Paragraph>
|
||||||
|
<TextRuns>
|
||||||
|
<TextRun>
|
||||||
|
<Value>Количество заказов</Value>
|
||||||
|
<Style>
|
||||||
|
<FontWeight>Bold</FontWeight>
|
||||||
|
</Style>
|
||||||
|
</TextRun>
|
||||||
|
</TextRuns>
|
||||||
|
<Style />
|
||||||
|
</Paragraph>
|
||||||
|
</Paragraphs>
|
||||||
|
<rd:DefaultName>TextboxCount</rd:DefaultName>
|
||||||
|
<Style>
|
||||||
|
<Border>
|
||||||
|
<Color>LightGrey</Color>
|
||||||
|
<Style>Solid</Style>
|
||||||
|
</Border>
|
||||||
|
<PaddingLeft>2pt</PaddingLeft>
|
||||||
|
<PaddingRight>2pt</PaddingRight>
|
||||||
|
<PaddingTop>2pt</PaddingTop>
|
||||||
|
<PaddingBottom>2pt</PaddingBottom>
|
||||||
|
</Style>
|
||||||
|
</Textbox>
|
||||||
|
</CellContents>
|
||||||
|
</TablixCell>
|
||||||
|
<TablixCell>
|
||||||
|
<CellContents>
|
||||||
|
<Textbox Name="TextboxSum">
|
||||||
|
<CanGrow>true</CanGrow>
|
||||||
|
<KeepTogether>true</KeepTogether>
|
||||||
|
<Paragraphs>
|
||||||
|
<Paragraph>
|
||||||
|
<TextRuns>
|
||||||
|
<TextRun>
|
||||||
|
<Value>Сумма</Value>
|
||||||
|
<Style>
|
||||||
|
<FontWeight>Bold</FontWeight>
|
||||||
|
</Style>
|
||||||
|
</TextRun>
|
||||||
|
</TextRuns>
|
||||||
|
<Style />
|
||||||
|
</Paragraph>
|
||||||
|
</Paragraphs>
|
||||||
|
<rd:DefaultName>TextboxSum</rd:DefaultName>
|
||||||
|
<Style>
|
||||||
|
<Border>
|
||||||
|
<Color>LightGrey</Color>
|
||||||
|
<Style>Solid</Style>
|
||||||
|
</Border>
|
||||||
|
<PaddingLeft>2pt</PaddingLeft>
|
||||||
|
<PaddingRight>2pt</PaddingRight>
|
||||||
|
<PaddingTop>2pt</PaddingTop>
|
||||||
|
<PaddingBottom>2pt</PaddingBottom>
|
||||||
|
</Style>
|
||||||
|
</Textbox>
|
||||||
|
</CellContents>
|
||||||
|
</TablixCell>
|
||||||
|
</TablixCells>
|
||||||
|
</TablixRow>
|
||||||
|
<TablixRow>
|
||||||
|
<Height>0.6cm</Height>
|
||||||
|
<TablixCells>
|
||||||
|
<TablixCell>
|
||||||
|
<CellContents>
|
||||||
|
<Textbox Name="Date">
|
||||||
|
<CanGrow>true</CanGrow>
|
||||||
|
<KeepTogether>true</KeepTogether>
|
||||||
|
<Paragraphs>
|
||||||
|
<Paragraph>
|
||||||
|
<TextRuns>
|
||||||
|
<TextRun>
|
||||||
|
<Value>=Fields!Date.Value</Value>
|
||||||
|
<Style>
|
||||||
|
<Format>dd.MM.yyyy</Format>
|
||||||
|
</Style>
|
||||||
|
</TextRun>
|
||||||
|
</TextRuns>
|
||||||
|
<Style />
|
||||||
|
</Paragraph>
|
||||||
|
</Paragraphs>
|
||||||
|
<rd:DefaultName>Date</rd:DefaultName>
|
||||||
|
<Style>
|
||||||
|
<Border>
|
||||||
|
<Color>LightGrey</Color>
|
||||||
|
<Style>Solid</Style>
|
||||||
|
</Border>
|
||||||
|
<PaddingLeft>2pt</PaddingLeft>
|
||||||
|
<PaddingRight>2pt</PaddingRight>
|
||||||
|
<PaddingTop>2pt</PaddingTop>
|
||||||
|
<PaddingBottom>2pt</PaddingBottom>
|
||||||
|
</Style>
|
||||||
|
</Textbox>
|
||||||
|
</CellContents>
|
||||||
|
</TablixCell>
|
||||||
|
<TablixCell>
|
||||||
|
<CellContents>
|
||||||
|
<Textbox Name="Count">
|
||||||
|
<CanGrow>true</CanGrow>
|
||||||
|
<KeepTogether>true</KeepTogether>
|
||||||
|
<Paragraphs>
|
||||||
|
<Paragraph>
|
||||||
|
<TextRuns>
|
||||||
|
<TextRun>
|
||||||
|
<Value>=Fields!Count.Value</Value>
|
||||||
|
<Style />
|
||||||
|
</TextRun>
|
||||||
|
</TextRuns>
|
||||||
|
<Style />
|
||||||
|
</Paragraph>
|
||||||
|
</Paragraphs>
|
||||||
|
<rd:DefaultName>Count</rd:DefaultName>
|
||||||
|
<Style>
|
||||||
|
<Border>
|
||||||
|
<Color>LightGrey</Color>
|
||||||
|
<Style>Solid</Style>
|
||||||
|
</Border>
|
||||||
|
<PaddingLeft>2pt</PaddingLeft>
|
||||||
|
<PaddingRight>2pt</PaddingRight>
|
||||||
|
<PaddingTop>2pt</PaddingTop>
|
||||||
|
<PaddingBottom>2pt</PaddingBottom>
|
||||||
|
</Style>
|
||||||
|
</Textbox>
|
||||||
|
</CellContents>
|
||||||
|
</TablixCell>
|
||||||
|
<TablixCell>
|
||||||
|
<CellContents>
|
||||||
|
<Textbox Name="Sum">
|
||||||
|
<CanGrow>true</CanGrow>
|
||||||
|
<KeepTogether>true</KeepTogether>
|
||||||
|
<Paragraphs>
|
||||||
|
<Paragraph>
|
||||||
|
<TextRuns>
|
||||||
|
<TextRun>
|
||||||
|
<Value>=Fields!Sum.Value</Value>
|
||||||
|
<Style />
|
||||||
|
</TextRun>
|
||||||
|
</TextRuns>
|
||||||
|
<Style />
|
||||||
|
</Paragraph>
|
||||||
|
</Paragraphs>
|
||||||
|
<rd:DefaultName>Sum</rd:DefaultName>
|
||||||
|
<Style>
|
||||||
|
<Border>
|
||||||
|
<Color>LightGrey</Color>
|
||||||
|
<Style>Solid</Style>
|
||||||
|
</Border>
|
||||||
|
<PaddingLeft>2pt</PaddingLeft>
|
||||||
|
<PaddingRight>2pt</PaddingRight>
|
||||||
|
<PaddingTop>2pt</PaddingTop>
|
||||||
|
<PaddingBottom>2pt</PaddingBottom>
|
||||||
|
</Style>
|
||||||
|
</Textbox>
|
||||||
|
</CellContents>
|
||||||
|
</TablixCell>
|
||||||
|
</TablixCells>
|
||||||
|
</TablixRow>
|
||||||
|
</TablixRows>
|
||||||
|
</TablixBody>
|
||||||
|
<TablixColumnHierarchy>
|
||||||
|
<TablixMembers>
|
||||||
|
<TablixMember />
|
||||||
|
<TablixMember />
|
||||||
|
<TablixMember />
|
||||||
|
</TablixMembers>
|
||||||
|
</TablixColumnHierarchy>
|
||||||
|
<TablixRowHierarchy>
|
||||||
|
<TablixMembers>
|
||||||
|
<TablixMember>
|
||||||
|
<KeepWithGroup>After</KeepWithGroup>
|
||||||
|
</TablixMember>
|
||||||
|
<TablixMember>
|
||||||
|
<Group Name="Подробности" />
|
||||||
|
</TablixMember>
|
||||||
|
</TablixMembers>
|
||||||
|
</TablixRowHierarchy>
|
||||||
|
<DataSetName>DataSetOrders</DataSetName>
|
||||||
|
<Top>1.95474cm</Top>
|
||||||
|
<Left>1.16099cm</Left>
|
||||||
|
<Height>1.2cm</Height>
|
||||||
|
<Width>18.7013cm</Width>
|
||||||
|
<ZIndex>1</ZIndex>
|
||||||
|
<Style>
|
||||||
|
<Border>
|
||||||
|
<Style>Double</Style>
|
||||||
|
</Border>
|
||||||
|
</Style>
|
||||||
|
</Tablix>
|
||||||
|
<Textbox Name="TextboxTotal">
|
||||||
|
<CanGrow>true</CanGrow>
|
||||||
|
<KeepTogether>true</KeepTogether>
|
||||||
|
<Paragraphs>
|
||||||
|
<Paragraph>
|
||||||
|
<TextRuns>
|
||||||
|
<TextRun>
|
||||||
|
<Value>Всего:</Value>
|
||||||
|
<Style>
|
||||||
|
<FontWeight>Bold</FontWeight>
|
||||||
|
</Style>
|
||||||
|
</TextRun>
|
||||||
|
</TextRuns>
|
||||||
|
<Style>
|
||||||
|
<TextAlign>Right</TextAlign>
|
||||||
|
</Style>
|
||||||
|
</Paragraph>
|
||||||
|
</Paragraphs>
|
||||||
|
<Top>4cm</Top>
|
||||||
|
<Left>11.23542cm</Left>
|
||||||
|
<Height>0.6cm</Height>
|
||||||
|
<Width>2.5cm</Width>
|
||||||
|
<ZIndex>2</ZIndex>
|
||||||
|
<Style>
|
||||||
|
<Border>
|
||||||
|
<Style>None</Style>
|
||||||
|
</Border>
|
||||||
|
<PaddingLeft>2pt</PaddingLeft>
|
||||||
|
<PaddingRight>2pt</PaddingRight>
|
||||||
|
<PaddingTop>2pt</PaddingTop>
|
||||||
|
<PaddingBottom>2pt</PaddingBottom>
|
||||||
|
</Style>
|
||||||
|
</Textbox>
|
||||||
|
<Textbox Name="TextboxTotalSum">
|
||||||
|
<CanGrow>true</CanGrow>
|
||||||
|
<KeepTogether>true</KeepTogether>
|
||||||
|
<Paragraphs>
|
||||||
|
<Paragraph>
|
||||||
|
<TextRuns>
|
||||||
|
<TextRun>
|
||||||
|
<Value>=Sum(Fields!Sum.Value, "DataSetOrders")</Value>
|
||||||
|
<Style>
|
||||||
|
<FontWeight>Bold</FontWeight>
|
||||||
|
</Style>
|
||||||
|
</TextRun>
|
||||||
|
</TextRuns>
|
||||||
|
<Style>
|
||||||
|
<TextAlign>Right</TextAlign>
|
||||||
|
</Style>
|
||||||
|
</Paragraph>
|
||||||
|
</Paragraphs>
|
||||||
|
<Top>4cm</Top>
|
||||||
|
<Left>13.73542cm</Left>
|
||||||
|
<Height>0.6cm</Height>
|
||||||
|
<Width>6.12687cm</Width>
|
||||||
|
<ZIndex>3</ZIndex>
|
||||||
|
<Style>
|
||||||
|
<Border>
|
||||||
|
<Style>None</Style>
|
||||||
|
</Border>
|
||||||
|
<PaddingLeft>2pt</PaddingLeft>
|
||||||
|
<PaddingRight>2pt</PaddingRight>
|
||||||
|
<PaddingTop>2pt</PaddingTop>
|
||||||
|
<PaddingBottom>2pt</PaddingBottom>
|
||||||
|
</Style>
|
||||||
|
</Textbox>
|
||||||
|
</ReportItems>
|
||||||
|
<Height>5.72875cm</Height>
|
||||||
|
<Style />
|
||||||
|
</Body>
|
||||||
|
<Width>21cm</Width>
|
||||||
|
<Page>
|
||||||
|
<PageHeight>29.7cm</PageHeight>
|
||||||
|
<PageWidth>21cm</PageWidth>
|
||||||
|
<LeftMargin>2cm</LeftMargin>
|
||||||
|
<RightMargin>2cm</RightMargin>
|
||||||
|
<TopMargin>2cm</TopMargin>
|
||||||
|
<BottomMargin>2cm</BottomMargin>
|
||||||
|
<ColumnSpacing>0.13cm</ColumnSpacing>
|
||||||
|
<Style />
|
||||||
|
</Page>
|
||||||
|
</ReportSection>
|
||||||
|
</ReportSections>
|
||||||
|
<ReportParameters>
|
||||||
|
<ReportParameter Name="ReportParameterPeriod">
|
||||||
|
<DataType>String</DataType>
|
||||||
|
<Nullable>true</Nullable>
|
||||||
|
<Prompt>ReportParameter1</Prompt>
|
||||||
|
</ReportParameter>
|
||||||
|
</ReportParameters>
|
||||||
|
<ReportParametersLayout>
|
||||||
|
<GridLayoutDefinition>
|
||||||
|
<NumberOfColumns>4</NumberOfColumns>
|
||||||
|
<NumberOfRows>2</NumberOfRows>
|
||||||
|
<CellDefinitions>
|
||||||
|
<CellDefinition>
|
||||||
|
<ColumnIndex>0</ColumnIndex>
|
||||||
|
<RowIndex>0</RowIndex>
|
||||||
|
<ParameterName>ReportParameterPeriod</ParameterName>
|
||||||
|
</CellDefinition>
|
||||||
|
</CellDefinitions>
|
||||||
|
</GridLayoutDefinition>
|
||||||
|
</ReportParametersLayout>
|
||||||
|
<rd:ReportUnitType>Cm</rd:ReportUnitType>
|
||||||
|
<rd:ReportID>2de0031a-4d17-449d-922d-d9fc54572312</rd:ReportID>
|
||||||
|
</Report>
|
Loading…
Reference in New Issue
Block a user