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