Naming Update plus log
This commit is contained in:
parent
e9f8e389ff
commit
32bd22a63e
@ -129,17 +129,20 @@ namespace SewingDressesBusinessLogic.BusinessLogic
|
|||||||
throw new ArgumentNullException("Количество должно быть положительным числом");
|
throw new ArgumentNullException("Количество должно быть положительным числом");
|
||||||
|
|
||||||
ShopViewModel? curModel = _shopStorage.GetElement(model);
|
ShopViewModel? curModel = _shopStorage.GetElement(model);
|
||||||
_logger.LogInformation("Make Supply");
|
_logger.LogInformation("Make Supply. Id: {Id}. ShopName: {Name}",model.Id, model.Name);
|
||||||
if (curModel == null)
|
if (curModel == null)
|
||||||
throw new ArgumentNullException(nameof(curModel));
|
throw new ArgumentNullException(nameof(curModel));
|
||||||
if (curModel.ShopDresses.TryGetValue(dress.Id, out var pair))
|
if (curModel.ShopDresses.TryGetValue(dress.Id, out var pair))
|
||||||
{
|
{
|
||||||
curModel.ShopDresses[dress.Id] = (pair.Item1, pair.Item2 + count);
|
curModel.ShopDresses[dress.Id] = (pair.Item1, pair.Item2 + count);
|
||||||
|
_logger.LogInformation("Make Supply. Add Dress. DressName: {Name}. Count: {Count}", pair.Item1, count + pair.Item2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
curModel.ShopDresses.Add(dress.Id, (dress, count));
|
curModel.ShopDresses.Add(dress.Id, (dress, count));
|
||||||
|
_logger.LogInformation("Make Supply. Add new Dress. DressName: {Name}. Count: {Count}", pair.Item1, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Update(new()
|
return Update(new()
|
||||||
{
|
{
|
||||||
Id = curModel.Id,
|
Id = curModel.Id,
|
||||||
|
@ -97,7 +97,7 @@
|
|||||||
Controls.Add(buttonAdd);
|
Controls.Add(buttonAdd);
|
||||||
Controls.Add(dataGridView);
|
Controls.Add(dataGridView);
|
||||||
Name = "ComponentsForm";
|
Name = "ComponentsForm";
|
||||||
Text = "ComponentsForm";
|
Text = "Форма компонентов";
|
||||||
Load += ComponentsForm_Load;
|
Load += ComponentsForm_Load;
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
@ -97,7 +97,7 @@
|
|||||||
Controls.Add(buttonAdd);
|
Controls.Add(buttonAdd);
|
||||||
Controls.Add(dataGridView);
|
Controls.Add(dataGridView);
|
||||||
Name = "DressesForm";
|
Name = "DressesForm";
|
||||||
Text = "DressesForm";
|
Text = "Форма с платьем";
|
||||||
Load += DressesForm_Load;
|
Load += DressesForm_Load;
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
@ -123,7 +123,7 @@
|
|||||||
Controls.Add(label2);
|
Controls.Add(label2);
|
||||||
Controls.Add(label1);
|
Controls.Add(label1);
|
||||||
Name = "OrderForm";
|
Name = "OrderForm";
|
||||||
Text = "OrderForm";
|
Text = "Форма заказа";
|
||||||
Load += OrderForm_Load;
|
Load += OrderForm_Load;
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
|
@ -99,7 +99,7 @@ namespace SewingDressesView
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var list = _logicD.ReadList(null);
|
var list = _logicD.ReadList(null);
|
||||||
if (list != null)
|
if (list != null)
|
||||||
{
|
{
|
||||||
comboBoxDress.DisplayMember = "DressName";
|
comboBoxDress.DisplayMember = "DressName";
|
||||||
comboBoxDress.ValueMember = "Id";
|
comboBoxDress.ValueMember = "Id";
|
||||||
|
68
SewingDresses/SewingDressesView/ShopForm.Designer.cs
generated
68
SewingDresses/SewingDressesView/ShopForm.Designer.cs
generated
@ -32,15 +32,15 @@
|
|||||||
textBoxName = new TextBox();
|
textBoxName = new TextBox();
|
||||||
textBoxAdress = new TextBox();
|
textBoxAdress = new TextBox();
|
||||||
dataGridView = new DataGridView();
|
dataGridView = new DataGridView();
|
||||||
|
IdColumn = new DataGridViewTextBoxColumn();
|
||||||
|
Title = new DataGridViewTextBoxColumn();
|
||||||
|
Cost = new DataGridViewTextBoxColumn();
|
||||||
|
Count = new DataGridViewTextBoxColumn();
|
||||||
buttonSave = new Button();
|
buttonSave = new Button();
|
||||||
buttonCancel = new Button();
|
buttonCancel = new Button();
|
||||||
label1 = new Label();
|
label1 = new Label();
|
||||||
label2 = new Label();
|
label2 = new Label();
|
||||||
label3 = new Label();
|
label3 = new Label();
|
||||||
IdColumn = new DataGridViewTextBoxColumn();
|
|
||||||
Title = new DataGridViewTextBoxColumn();
|
|
||||||
Cost = new DataGridViewTextBoxColumn();
|
|
||||||
Count = new DataGridViewTextBoxColumn();
|
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
@ -76,6 +76,35 @@
|
|||||||
dataGridView.Size = new Size(554, 380);
|
dataGridView.Size = new Size(554, 380);
|
||||||
dataGridView.TabIndex = 3;
|
dataGridView.TabIndex = 3;
|
||||||
//
|
//
|
||||||
|
// IdColumn
|
||||||
|
//
|
||||||
|
IdColumn.HeaderText = "Номер платья";
|
||||||
|
IdColumn.MinimumWidth = 6;
|
||||||
|
IdColumn.Name = "IdColumn";
|
||||||
|
IdColumn.Visible = false;
|
||||||
|
IdColumn.Width = 125;
|
||||||
|
//
|
||||||
|
// Title
|
||||||
|
//
|
||||||
|
Title.HeaderText = "Название";
|
||||||
|
Title.MinimumWidth = 6;
|
||||||
|
Title.Name = "Title";
|
||||||
|
Title.Width = 125;
|
||||||
|
//
|
||||||
|
// Cost
|
||||||
|
//
|
||||||
|
Cost.HeaderText = "Цена";
|
||||||
|
Cost.MinimumWidth = 6;
|
||||||
|
Cost.Name = "Cost";
|
||||||
|
Cost.Width = 125;
|
||||||
|
//
|
||||||
|
// Count
|
||||||
|
//
|
||||||
|
Count.HeaderText = "Количество";
|
||||||
|
Count.MinimumWidth = 6;
|
||||||
|
Count.Name = "Count";
|
||||||
|
Count.Width = 125;
|
||||||
|
//
|
||||||
// buttonSave
|
// buttonSave
|
||||||
//
|
//
|
||||||
buttonSave.Location = new Point(714, 219);
|
buttonSave.Location = new Point(714, 219);
|
||||||
@ -123,35 +152,6 @@
|
|||||||
label3.TabIndex = 8;
|
label3.TabIndex = 8;
|
||||||
label3.Text = "Адрес";
|
label3.Text = "Адрес";
|
||||||
//
|
//
|
||||||
// IdColumn
|
|
||||||
//
|
|
||||||
IdColumn.HeaderText = "Номер платья";
|
|
||||||
IdColumn.MinimumWidth = 6;
|
|
||||||
IdColumn.Name = "IdColumn";
|
|
||||||
IdColumn.Visible = false;
|
|
||||||
IdColumn.Width = 125;
|
|
||||||
//
|
|
||||||
// Title
|
|
||||||
//
|
|
||||||
Title.HeaderText = "Название";
|
|
||||||
Title.MinimumWidth = 6;
|
|
||||||
Title.Name = "Title";
|
|
||||||
Title.Width = 125;
|
|
||||||
//
|
|
||||||
// Cost
|
|
||||||
//
|
|
||||||
Cost.HeaderText = "Цена";
|
|
||||||
Cost.MinimumWidth = 6;
|
|
||||||
Cost.Name = "Cost";
|
|
||||||
Cost.Width = 125;
|
|
||||||
//
|
|
||||||
// Count
|
|
||||||
//
|
|
||||||
Count.HeaderText = "Количество";
|
|
||||||
Count.MinimumWidth = 6;
|
|
||||||
Count.Name = "Count";
|
|
||||||
Count.Width = 125;
|
|
||||||
//
|
|
||||||
// ShopForm
|
// ShopForm
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
@ -167,7 +167,7 @@
|
|||||||
Controls.Add(textBoxName);
|
Controls.Add(textBoxName);
|
||||||
Controls.Add(dateTimePicker);
|
Controls.Add(dateTimePicker);
|
||||||
Name = "ShopForm";
|
Name = "ShopForm";
|
||||||
Text = "ShopForm";
|
Text = "Форма магазина";
|
||||||
Load += ShopForm_Load;
|
Load += ShopForm_Load;
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
@ -97,7 +97,7 @@
|
|||||||
Controls.Add(buttonAdd);
|
Controls.Add(buttonAdd);
|
||||||
Controls.Add(dataGridView);
|
Controls.Add(dataGridView);
|
||||||
Name = "ShopsForm";
|
Name = "ShopsForm";
|
||||||
Text = "ShopsForm";
|
Text = "Магазины";
|
||||||
Load += ShopsForm_Load;
|
Load += ShopsForm_Load;
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
@ -122,7 +122,7 @@
|
|||||||
Controls.Add(DressComboBox);
|
Controls.Add(DressComboBox);
|
||||||
Controls.Add(ShopComboBox);
|
Controls.Add(ShopComboBox);
|
||||||
Name = "SupplyForm";
|
Name = "SupplyForm";
|
||||||
Text = "SupplyForm";
|
Text = "Форма поставки";
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user