This commit is contained in:
Данияр Аглиуллов 2023-02-05 21:18:49 +04:00
commit 485b7cb3dd
11 changed files with 19 additions and 95 deletions

View File

@ -2,10 +2,9 @@
using ConfectioneryContracts.SearchModels;
using ConfectioneryContracts.StoragesContract;
using ConfectioneryContracts.ViewModels;
using ConfectioneryListImplement;
using ConfectioneryListImplement.Models;
namespace AbstractShopListImplement.Implements
namespace ConfectioneryListImplement.Implements
{
public class ComponentStorage : IComponentStorage
{
@ -23,8 +22,7 @@ namespace AbstractShopListImplement.Implements
}
return result;
}
public List<ComponentViewModel> GetFilteredList(ComponentSearchModel
model)
public List<ComponentViewModel> GetFilteredList(ComponentSearchModel model)
{
var result = new List<ComponentViewModel>();
if (string.IsNullOrEmpty(model.ComponentName))

View File

@ -100,7 +100,7 @@
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "FormComponent";
this.Text = "FormComponent";
this.Text = "Создание компонента";
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -103,7 +103,7 @@
this.Controls.Add(this.buttonAdd);
this.Controls.Add(this.dataGridView);
this.Name = "FormComponents";
this.Text = "FormComponents";
this.Text = "Редактирование компонентов";
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.ResumeLayout(false);

View File

@ -55,18 +55,15 @@ namespace ConfectioneryView
{
if (dataGridView.SelectedRows.Count == 1)
{
var service =
Program.ServiceProvider?.GetService(typeof(FormComponent));
var service = Program.ServiceProvider?.GetService(typeof(FormComponent));
if (service is FormComponent form)
{
form.Id =
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
if (form.ShowDialog() == DialogResult.OK)
{
LoadData();
}
}
LoadData();
}
}
private void ButtonDel_Click(object sender, EventArgs e)

View File

@ -127,7 +127,7 @@
this.Controls.Add(this.label1);
this.Name = "FormCreateOrder";
this.Text = "Создание заказа";
this.Load += new System.EventHandler(this.FormCreateOrder_Load_1);
this.Load += new System.EventHandler(this.FormCreateOrder_Load);
((System.ComponentModel.ISupportInitialize)(this.textBoxCount)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -114,12 +114,6 @@ namespace ConfectioneryView
DialogResult = DialogResult.Cancel;
Close();
}
private void FormCreateOrder_Load_1(object sender, EventArgs e)
{
}
}
}

View File

@ -102,12 +102,10 @@ namespace ConfectioneryView
{
if (dataGridView.SelectedRows.Count == 1)
{
var service =
Program.ServiceProvider?.GetService(typeof(FormPastryComponent));
var service = Program.ServiceProvider?.GetService(typeof(FormPastryComponent));
if (service is FormPastryComponent form)
{
int id =
Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value);
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value);
form.Id = id;
form.Count = _pastryComponents[id].Item2;
if (form.ShowDialog() == DialogResult.OK)
@ -118,8 +116,7 @@ namespace ConfectioneryView
}
_logger.LogInformation("Изменение компонента: { ComponentName} - { Count} ",
form.ComponentModel.ComponentName, form.Count);
_pastryComponents[form.Id] = (form.ComponentModel,
form.Count);
_pastryComponents[id] = (form.ComponentModel, form.Count);
LoadData();
}
}

View File

@ -103,7 +103,7 @@
this.Controls.Add(this.buttonAdd);
this.Controls.Add(this.dataGridView);
this.Name = "FormViewPastry";
this.Text = "FormViewPastry";
this.Text = "Редактирование изделий";
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.ResumeLayout(false);

View File

@ -63,12 +63,10 @@ namespace ConfectioneryView
{
if (dataGridView.SelectedRows.Count == 1)
{
var service =
Program.ServiceProvider?.GetService(typeof(FormComponent));
if (service is FormComponent form)
var service = Program.ServiceProvider?.GetService(typeof(FormPastryComponent));
if (service is FormPastryComponent form)
{
form.Id =
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
if (form.ShowDialog() == DialogResult.OK)
{

View File

@ -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">

View File

@ -1,4 +1,4 @@
using AbstractShopListImplement.Implements;
using ConfectioneryListImplement.Implements;
using ConfectioneryBusinessLogic;
using ConfectioneryBusinessLogic.BusinessLogics;
using ConfectioneryContracts.BusinessLogicsContracts;