fix
This commit is contained in:
parent
2cb3292cf8
commit
1262146e7a
@ -68,7 +68,6 @@ namespace ConfectioneryBusinessLogic
|
||||
throw new ArgumentNullException("Нет названия магазина",
|
||||
nameof(model.Name));
|
||||
}
|
||||
model.Pastries = new();
|
||||
if (_shopStorage.Update(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Update operation failed");
|
||||
@ -137,7 +136,7 @@ namespace ConfectioneryBusinessLogic
|
||||
|
||||
if (element.Pastries.TryGetValue(pastry.Id, out var pair))
|
||||
{
|
||||
pair.Item2 += count;
|
||||
element.Pastries[pastry.Id] = (pastry, count + pair.Item2);
|
||||
_logger.LogInformation(
|
||||
"AddPastryInShop. Has been added {count} {pastry} in {ShopName}",
|
||||
count, pastry.PastryName, element.Name);
|
||||
@ -149,6 +148,14 @@ namespace ConfectioneryBusinessLogic
|
||||
"AddPastryInShop. Has been added {count} new Pastry {pastry} in {ShopName}",
|
||||
count, pastry.PastryName, element.Name);
|
||||
}
|
||||
_shopStorage.Update(new()
|
||||
{
|
||||
Id = element.Id,
|
||||
Address = element.Address,
|
||||
Name = element.Name,
|
||||
DateOpening = element.DateOpening,
|
||||
Pastries = element.Pastries
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ namespace ConfectioneryListImplement
|
||||
Name = model.Name,
|
||||
Address = model.Address,
|
||||
DateOpening = model.DateOpening,
|
||||
Pastries = model.Pastries
|
||||
Pastries = new()
|
||||
};
|
||||
}
|
||||
public void Update(ShopBindingModel? model)
|
||||
|
1
Confectionery/FormComponents.Designer.cs
generated
1
Confectionery/FormComponents.Designer.cs
generated
@ -104,6 +104,7 @@
|
||||
this.Controls.Add(this.dataGridView);
|
||||
this.Name = "FormComponents";
|
||||
this.Text = "Редактирование компонентов";
|
||||
this.Load += new System.EventHandler(this.FormComponents_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
|
1
Confectionery/FormMain.Designer.cs
generated
1
Confectionery/FormMain.Designer.cs
generated
@ -179,6 +179,7 @@
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Name = "FormMain";
|
||||
this.Text = "Кондитерская";
|
||||
this.Load += new System.EventHandler(this.FormMain_Load);
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||
|
@ -29,7 +29,8 @@ namespace ConfectioneryView
|
||||
if (list != null)
|
||||
{
|
||||
dataGridView.DataSource = list;
|
||||
dataGridView.Columns["Id"].Visible = false;
|
||||
dataGridView.Columns["Id"].HeaderText = "Íîìåð çàêàçà";
|
||||
dataGridView.Columns["PastryId"].Visible = false;
|
||||
dataGridView.Columns["PastryName"].AutoSizeMode =
|
||||
DataGridViewAutoSizeColumnMode.Fill;
|
||||
}
|
||||
|
1
Confectionery/FormPastry.Designer.cs
generated
1
Confectionery/FormPastry.Designer.cs
generated
@ -207,6 +207,7 @@
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "FormPastry";
|
||||
this.Text = "Кондитерское изделие";
|
||||
this.Load += new System.EventHandler(this.FormPastry_Load);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
@ -70,13 +70,6 @@ namespace ConfectioneryView
|
||||
comboBoxShop.Text = model.Name;
|
||||
textBoxAddress.Text = model.Address;
|
||||
textBoxDateOpening.Text = Convert.ToString(model.DateOpening);
|
||||
|
||||
textBoxAddress.Text = vmodel.Address;
|
||||
textBoxDateOpening.Text = Convert.ToString(vmodel.DateOpening);
|
||||
}
|
||||
textBoxAddress.Text = vmodel.Address;
|
||||
textBoxDateOpening.Text = Convert.ToString(vmodel.DateOpening);
|
||||
}
|
||||
dataGridView.Rows.Clear();
|
||||
foreach (var el in model.Pastries.Values)
|
||||
{
|
||||
|
1
Confectionery/FormViewPastry.Designer.cs
generated
1
Confectionery/FormViewPastry.Designer.cs
generated
@ -104,6 +104,7 @@
|
||||
this.Controls.Add(this.dataGridView);
|
||||
this.Name = "FormViewPastry";
|
||||
this.Text = "Редактирование изделий";
|
||||
this.Load += new System.EventHandler(this.FormViewPastry_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user