Реализован отчет изделий в формате таблицы
This commit is contained in:
parent
f1359d2657
commit
68ce43d50a
@ -18,7 +18,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
|
||||
}
|
||||
public List<ComponentViewModel>? ReadList(ComponentSearchModel? model)
|
||||
{
|
||||
_logger.LogInformation("ReadList. ComponentName:{ComponentName}.Id:{ Id} ",
|
||||
_logger.LogInformation("ReadList. PastryName:{PastryName}.Id:{ Id} ",
|
||||
model?.ComponentName, model?.Id);
|
||||
var list = (model == null) ? _componentStorage.GetFullList() :
|
||||
_componentStorage.GetFilteredList(model);
|
||||
@ -36,7 +36,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
|
||||
{
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
}
|
||||
_logger.LogInformation("ReadElement. ComponentName:{ComponentName}.Id:{ Id}",
|
||||
_logger.LogInformation("ReadElement. PastryName:{PastryName}.Id:{ Id}",
|
||||
model.ComponentName, model.Id);
|
||||
var element = _componentStorage.GetElement(model);
|
||||
if (element == null)
|
||||
@ -98,7 +98,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
|
||||
{
|
||||
throw new ArgumentNullException("Цена компонента должна быть больше 0", nameof(model.Cost));
|
||||
}
|
||||
_logger.LogInformation("Component. ComponentName:{ComponentName}.Cost:{ Cost}. Id: { Id}",
|
||||
_logger.LogInformation("Components. PastryName:{PastryName}.Cost:{ Cost}. Id: { Id}",
|
||||
model.ComponentName, model.Cost, model.Id);
|
||||
var element = _componentStorage.GetElement(new ComponentSearchModel
|
||||
{
|
||||
|
@ -39,12 +39,12 @@ namespace ConfectioneryBusinessLogic.OfficePackage
|
||||
{
|
||||
ColumnName = "A",
|
||||
RowIndex = rowIndex,
|
||||
Text = pc.ComponentName,
|
||||
Text = pc.PastryName,
|
||||
StyleInfo = ExcelStyleInfoType.Text
|
||||
});
|
||||
rowIndex++;
|
||||
|
||||
foreach (var (Pastry, Count) in pc.Pastries)
|
||||
foreach (var (Pastry, Count) in pc.Components)
|
||||
{
|
||||
InsertCellInWorksheet(new ExcelCellParameters
|
||||
{
|
||||
|
@ -47,24 +47,24 @@ namespace ConfectioneryBusinessLogic
|
||||
{
|
||||
var components = _componentStorage.GetFullList();
|
||||
|
||||
var Pastrys = _pastryStorage.GetFullList();
|
||||
var pastries = _pastryStorage.GetFullList();
|
||||
|
||||
var list = new List<ReportPastryComponentViewModel>();
|
||||
|
||||
foreach (var component in components)
|
||||
foreach (var pastry in pastries)
|
||||
{
|
||||
var record = new ReportPastryComponentViewModel
|
||||
{
|
||||
ComponentName = component.ComponentName,
|
||||
Pastries = new List<Tuple<string, int>>(),
|
||||
PastryName = pastry.PastryName,
|
||||
Components = new List<Tuple<string, int>>(),
|
||||
TotalCount = 0
|
||||
};
|
||||
foreach (var Pastry in Pastrys)
|
||||
foreach (var component in components)
|
||||
{
|
||||
if (Pastry.PastryComponents.ContainsKey(component.Id))
|
||||
if (pastry.PastryComponents.ContainsKey(component.Id))
|
||||
{
|
||||
record.Pastries.Add(new(Pastry.PastryName, Pastry.PastryComponents[component.Id].Item2));
|
||||
record.TotalCount += Pastry.PastryComponents[component.Id].Item2;
|
||||
record.Components.Add(new(component.ComponentName, pastry.PastryComponents[component.Id].Item2));
|
||||
record.TotalCount += pastry.PastryComponents[component.Id].Item2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ namespace ConfectioneryBusinessLogic
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Сохранение компонент в файл-Word
|
||||
/// Сохранение изделий в файл-Word
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public void SavePastriesToWordFile(ReportBindingModel model)
|
||||
@ -107,7 +107,7 @@ namespace ConfectioneryBusinessLogic
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Сохранение компонент с указаеним продуктов в файл-Excel
|
||||
/// Сохранение изделий с указаеним продуктов в файл-Excel
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public void SavePastryComponentToExcelFile(ReportBindingModel model)
|
||||
@ -115,7 +115,7 @@ namespace ConfectioneryBusinessLogic
|
||||
_saveToExcel.CreateReport(new ExcelInfo
|
||||
{
|
||||
FileName = model.FileName,
|
||||
Title = "Список компонент",
|
||||
Title = "Список изделий",
|
||||
PastryComponents = GetPastryComponent()
|
||||
});
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ namespace ConfectioneryFileImplement.Models
|
||||
return new Component()
|
||||
{
|
||||
Id = Convert.ToInt32(element.Attribute("Id")!.Value),
|
||||
ComponentName = element.Element("ComponentName")!.Value,
|
||||
ComponentName = element.Element("PastryName")!.Value,
|
||||
Cost = Convert.ToDouble(element.Element("Cost")!.Value)
|
||||
};
|
||||
}
|
||||
@ -52,9 +52,9 @@ namespace ConfectioneryFileImplement.Models
|
||||
ComponentName = ComponentName,
|
||||
Cost = Cost
|
||||
};
|
||||
public XElement GetXElement => new("Component",
|
||||
public XElement GetXElement => new("Components",
|
||||
new XAttribute("Id", Id),
|
||||
new XElement("ComponentName", ComponentName),
|
||||
new XElement("PastryName", ComponentName),
|
||||
new XElement("Cost", Cost.ToString()));
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ namespace ConfectioneryFileImplement
|
||||
public class DataFileSingleton
|
||||
{
|
||||
private static DataFileSingleton? instance;
|
||||
private readonly string ComponentFileName = "Component.xml";
|
||||
private readonly string ComponentFileName = "Components.xml";
|
||||
private readonly string OrderFileName = "Order.xml";
|
||||
private readonly string PastryFileName = "Pastry.xml";
|
||||
public List<Component> Components { get; private set; }
|
||||
@ -22,12 +22,12 @@ namespace ConfectioneryFileImplement
|
||||
return instance;
|
||||
}
|
||||
public void SaveComponents() => SaveData(Components, ComponentFileName, "Components", x => x.GetXElement);
|
||||
public void SavePastries() => SaveData(Pastries, PastryFileName, "Pastries", x => x.GetXElement);
|
||||
public void SavePastries() => SaveData(Pastries, PastryFileName, "Components", x => x.GetXElement);
|
||||
public void SaveOrders() => SaveData(Orders, OrderFileName, "Orders", x => x.GetXElement);
|
||||
|
||||
private DataFileSingleton()
|
||||
{
|
||||
Components = LoadData(ComponentFileName, "Component", x => Component.Create(x)!)!;
|
||||
Components = LoadData(ComponentFileName, "Components", x => Component.Create(x)!)!;
|
||||
Pastries = LoadData(PastryFileName, "Pastry", x => Pastry.Create(x)!)!;
|
||||
Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ namespace ConfectioneryView
|
||||
{
|
||||
dataGridView.DataSource = list;
|
||||
dataGridView.Columns["Id"].Visible = false;
|
||||
dataGridView.Columns["ComponentName"].AutoSizeMode =
|
||||
dataGridView.Columns["PastryName"].AutoSizeMode =
|
||||
DataGridViewAutoSizeColumnMode.Fill;
|
||||
}
|
||||
_logger.LogInformation("Загрузка компонентов");
|
||||
|
8
Confectionery/FormMain.Designer.cs
generated
8
Confectionery/FormMain.Designer.cs
generated
@ -86,21 +86,21 @@
|
||||
// pastriesToolStripMenuItem
|
||||
//
|
||||
pastriesToolStripMenuItem.Name = "pastriesToolStripMenuItem";
|
||||
pastriesToolStripMenuItem.Size = new Size(218, 22);
|
||||
pastriesToolStripMenuItem.Size = new Size(215, 22);
|
||||
pastriesToolStripMenuItem.Text = "Список изделий";
|
||||
pastriesToolStripMenuItem.Click += PastriesToolStripMenuItem_Click_1;
|
||||
//
|
||||
// pastryComponentsToolStripMenuItem
|
||||
//
|
||||
pastryComponentsToolStripMenuItem.Name = "pastryComponentsToolStripMenuItem";
|
||||
pastryComponentsToolStripMenuItem.Size = new Size(218, 22);
|
||||
pastryComponentsToolStripMenuItem.Text = "Компоненты по изделиям";
|
||||
pastryComponentsToolStripMenuItem.Size = new Size(215, 22);
|
||||
pastryComponentsToolStripMenuItem.Text = "Изделия с компонентами";
|
||||
pastryComponentsToolStripMenuItem.Click += PastryComponentsToolStripMenuItem_Click;
|
||||
//
|
||||
// ordersToolStripMenuItem
|
||||
//
|
||||
ordersToolStripMenuItem.Name = "ordersToolStripMenuItem";
|
||||
ordersToolStripMenuItem.Size = new Size(218, 22);
|
||||
ordersToolStripMenuItem.Size = new Size(215, 22);
|
||||
ordersToolStripMenuItem.Text = "Список заказов";
|
||||
ordersToolStripMenuItem.Click += OrdersToolStripMenuItem_Click;
|
||||
//
|
||||
|
4
Confectionery/FormPastry.Designer.cs
generated
4
Confectionery/FormPastry.Designer.cs
generated
@ -144,12 +144,12 @@
|
||||
this.id.Name = "id";
|
||||
this.id.Visible = false;
|
||||
//
|
||||
// Component
|
||||
// Components
|
||||
//
|
||||
this.Component.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.Component.FillWeight = 1000F;
|
||||
this.Component.HeaderText = "Компонент";
|
||||
this.Component.Name = "Component";
|
||||
this.Component.Name = "Components";
|
||||
//
|
||||
// Count
|
||||
//
|
||||
|
@ -82,7 +82,7 @@ namespace ConfectioneryView
|
||||
{
|
||||
return;
|
||||
}
|
||||
_logger.LogInformation("Добавление нового компонента: { ComponentName}- { Count}",
|
||||
_logger.LogInformation("Добавление нового компонента: { PastryName}- { Count}",
|
||||
form.ComponentModel.ComponentName, form.Count);
|
||||
if (_pastryComponents.ContainsKey(form.Id))
|
||||
{
|
||||
@ -114,7 +114,7 @@ namespace ConfectioneryView
|
||||
{
|
||||
return;
|
||||
}
|
||||
_logger.LogInformation("Изменение компонента: { ComponentName} - { Count} ",
|
||||
_logger.LogInformation("Изменение компонента: { PastryName} - { Count} ",
|
||||
form.ComponentModel.ComponentName, form.Count);
|
||||
_pastryComponents[id] = (form.ComponentModel, form.Count);
|
||||
LoadData();
|
||||
@ -131,7 +131,7 @@ namespace ConfectioneryView
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("Удаление компонента: { ComponentName}- { Count}",
|
||||
_logger.LogInformation("Удаление компонента: { PastryName}- { Count}",
|
||||
dataGridView.SelectedRows[0].Cells[1].Value);
|
||||
_pastryComponents?.Remove(Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value));
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ namespace ConfectioneryView
|
||||
_list = logic.ReadList(null);
|
||||
if (_list != null)
|
||||
{
|
||||
comboBoxComponent.DisplayMember = "ComponentName";
|
||||
comboBoxComponent.DisplayMember = "PastryName";
|
||||
comboBoxComponent.ValueMember = "Id";
|
||||
comboBoxComponent.DataSource = _list;
|
||||
comboBoxComponent.SelectedItem = null;
|
||||
|
121
Confectionery/FormReportPastryComponents.Designer.cs
generated
121
Confectionery/FormReportPastryComponents.Designer.cs
generated
@ -28,87 +28,86 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.dataGridView = new System.Windows.Forms.DataGridView();
|
||||
this.buttonSaveToExcel = new System.Windows.Forms.Button();
|
||||
this.ColumnComponent = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ColumnPastry = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ColumnCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
dataGridView = new DataGridView();
|
||||
buttonSaveToExcel = new Button();
|
||||
ColumnPastry = new DataGridViewTextBoxColumn();
|
||||
ColumnComponent = new DataGridViewTextBoxColumn();
|
||||
ColumnCount = new DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
this.dataGridView.AllowUserToAddRows = false;
|
||||
this.dataGridView.AllowUserToDeleteRows = false;
|
||||
this.dataGridView.AllowUserToOrderColumns = true;
|
||||
this.dataGridView.AllowUserToResizeColumns = false;
|
||||
this.dataGridView.AllowUserToResizeRows = false;
|
||||
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.ColumnComponent,
|
||||
this.ColumnPastry,
|
||||
this.ColumnCount});
|
||||
this.dataGridView.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.dataGridView.Location = new System.Drawing.Point(0, 41);
|
||||
this.dataGridView.MultiSelect = false;
|
||||
this.dataGridView.Name = "dataGridView";
|
||||
this.dataGridView.ReadOnly = true;
|
||||
this.dataGridView.RowHeadersVisible = false;
|
||||
this.dataGridView.Size = new System.Drawing.Size(528, 442);
|
||||
this.dataGridView.TabIndex = 0;
|
||||
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[] { ColumnPastry, ColumnComponent, 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
|
||||
//
|
||||
this.buttonSaveToExcel.Location = new System.Drawing.Point(12, 12);
|
||||
this.buttonSaveToExcel.Name = "buttonSaveToExcel";
|
||||
this.buttonSaveToExcel.Size = new System.Drawing.Size(159, 23);
|
||||
this.buttonSaveToExcel.TabIndex = 1;
|
||||
this.buttonSaveToExcel.Text = "Сохранить в Excel";
|
||||
this.buttonSaveToExcel.UseVisualStyleBackColor = true;
|
||||
this.buttonSaveToExcel.Click += new System.EventHandler(this.ButtonSaveToExcel_Click);
|
||||
//
|
||||
// ColumnComponent
|
||||
//
|
||||
this.ColumnComponent.HeaderText = "Компонент";
|
||||
this.ColumnComponent.Name = "ColumnComponent";
|
||||
this.ColumnComponent.ReadOnly = true;
|
||||
this.ColumnComponent.Width = 200;
|
||||
buttonSaveToExcel.Location = new Point(14, 14);
|
||||
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;
|
||||
//
|
||||
// ColumnPastry
|
||||
//
|
||||
this.ColumnPastry.HeaderText = "Изделие";
|
||||
this.ColumnPastry.Name = "ColumnPastry";
|
||||
this.ColumnPastry.ReadOnly = true;
|
||||
this.ColumnPastry.Width = 200;
|
||||
ColumnPastry.HeaderText = "Изделие";
|
||||
ColumnPastry.Name = "ColumnPastry";
|
||||
ColumnPastry.ReadOnly = true;
|
||||
ColumnPastry.Width = 200;
|
||||
//
|
||||
// ColumnComponent
|
||||
//
|
||||
ColumnComponent.HeaderText = "Компонент";
|
||||
ColumnComponent.Name = "ColumnComponent";
|
||||
ColumnComponent.ReadOnly = true;
|
||||
ColumnComponent.Width = 200;
|
||||
//
|
||||
// ColumnCount
|
||||
//
|
||||
this.ColumnCount.HeaderText = "Количество";
|
||||
this.ColumnCount.Name = "ColumnCount";
|
||||
this.ColumnCount.ReadOnly = true;
|
||||
ColumnCount.HeaderText = "Количество";
|
||||
ColumnCount.Name = "ColumnCount";
|
||||
ColumnCount.ReadOnly = true;
|
||||
//
|
||||
// FormReportPastryComponents
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(528, 483);
|
||||
this.Controls.Add(this.buttonSaveToExcel);
|
||||
this.Controls.Add(this.dataGridView);
|
||||
this.Name = "FormReportPastryComponents";
|
||||
this.Text = "Компоненты по изделиям";
|
||||
this.Load += new System.EventHandler(this.FormReportPastryComponents_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
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 = "FormReportPastryComponents";
|
||||
Text = "Изделия с компонентами";
|
||||
Load += FormReportPastryComponents_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dataGridView;
|
||||
private System.Windows.Forms.Button buttonSaveToExcel;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ColumnComponent;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ColumnPastry;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ColumnCount;
|
||||
private DataGridViewTextBoxColumn ColumnPastry;
|
||||
private DataGridViewTextBoxColumn ColumnComponent;
|
||||
private DataGridViewTextBoxColumn ColumnCount;
|
||||
}
|
||||
}
|
@ -36,8 +36,8 @@ namespace ConfectioneryView
|
||||
dataGridView.Rows.Clear();
|
||||
foreach (var elem in dict)
|
||||
{
|
||||
dataGridView.Rows.Add(new object[] { elem.ComponentName, "", "" });
|
||||
foreach (var listElem in elem.Pastries)
|
||||
dataGridView.Rows.Add(new object[] { elem.PastryName, "", "" });
|
||||
foreach (var listElem in elem.Components)
|
||||
{
|
||||
dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 });
|
||||
}
|
||||
|
@ -1,64 +1,4 @@
|
||||
<?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.
|
||||
-->
|
||||
<root>
|
||||
<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">
|
||||
|
@ -8,8 +8,8 @@ namespace ConfectioneryContracts.ViewModels
|
||||
{
|
||||
public class ReportPastryComponentViewModel
|
||||
{
|
||||
public string ComponentName { get; set; } = string.Empty;
|
||||
public string PastryName { get; set; } = string.Empty;
|
||||
public int TotalCount { get; set; }
|
||||
public List<Tuple<string, int>> Pastries { get; set; } = new();
|
||||
public List<Tuple<string, int>> Components { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Component", b =>
|
||||
modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Components", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@ -33,7 +33,7 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ComponentName")
|
||||
b.Property<string>("PastryName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
@ -95,7 +95,7 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Pastries");
|
||||
b.ToTable("Components");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.PastryComponent", b =>
|
||||
@ -137,7 +137,7 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
|
||||
modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.PastryComponent", b =>
|
||||
{
|
||||
b.HasOne("ConfectioneryDatabaseImplement.Models.Component", "Component")
|
||||
b.HasOne("ConfectioneryDatabaseImplement.Models.Components", "Components")
|
||||
.WithMany("PastryComponents")
|
||||
.HasForeignKey("ComponentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@ -149,12 +149,12 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Component");
|
||||
b.Navigation("Components");
|
||||
|
||||
b.Navigation("Pastry");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Component", b =>
|
||||
modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Components", b =>
|
||||
{
|
||||
b.Navigation("PastryComponents");
|
||||
});
|
||||
|
@ -26,7 +26,7 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Pastries",
|
||||
name: "Components",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
@ -58,7 +58,7 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
table.ForeignKey(
|
||||
name: "FK_Orders_Pastries_PastryId",
|
||||
column: x => x.PastryId,
|
||||
principalTable: "Pastries",
|
||||
principalTable: "Components",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
@ -85,7 +85,7 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
table.ForeignKey(
|
||||
name: "FK_PastryComponents_Pastries_PastryId",
|
||||
column: x => x.PastryId,
|
||||
principalTable: "Pastries",
|
||||
principalTable: "Components",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
@ -119,7 +119,7 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
name: "Components");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Pastries");
|
||||
name: "Components");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Component", b =>
|
||||
modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Components", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@ -30,7 +30,7 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ComponentName")
|
||||
b.Property<string>("PastryName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
@ -92,7 +92,7 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Pastries");
|
||||
b.ToTable("Components");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.PastryComponent", b =>
|
||||
@ -134,7 +134,7 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
|
||||
modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.PastryComponent", b =>
|
||||
{
|
||||
b.HasOne("ConfectioneryDatabaseImplement.Models.Component", "Component")
|
||||
b.HasOne("ConfectioneryDatabaseImplement.Models.Components", "Components")
|
||||
.WithMany("PastryComponents")
|
||||
.HasForeignKey("ComponentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@ -146,12 +146,12 @@ namespace ConfectioneryDatabaseImplement.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Component");
|
||||
b.Navigation("Components");
|
||||
|
||||
b.Navigation("Pastry");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Component", b =>
|
||||
modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Components", b =>
|
||||
{
|
||||
b.Navigation("PastryComponents");
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user