Обновлена форма создания магазина
This commit is contained in:
parent
77909f0d52
commit
1cafb3ef98
@ -40,13 +40,15 @@
|
|||||||
this.FurnitureId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.FurnitureId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
this.FurnitureName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.FurnitureName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
this.Count = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.Count = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.textBoxMaxCount = new System.Windows.Forms.TextBox();
|
||||||
|
this.labelMaxCount = new System.Windows.Forms.Label();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// labelShopName
|
// labelShopName
|
||||||
//
|
//
|
||||||
this.labelShopName.AutoSize = true;
|
this.labelShopName.AutoSize = true;
|
||||||
this.labelShopName.Location = new System.Drawing.Point(37, 45);
|
this.labelShopName.Location = new System.Drawing.Point(35, 22);
|
||||||
this.labelShopName.Name = "labelShopName";
|
this.labelShopName.Name = "labelShopName";
|
||||||
this.labelShopName.Size = new System.Drawing.Size(113, 15);
|
this.labelShopName.Size = new System.Drawing.Size(113, 15);
|
||||||
this.labelShopName.TabIndex = 0;
|
this.labelShopName.TabIndex = 0;
|
||||||
@ -54,14 +56,14 @@
|
|||||||
//
|
//
|
||||||
// textBoxName
|
// textBoxName
|
||||||
//
|
//
|
||||||
this.textBoxName.Location = new System.Drawing.Point(168, 42);
|
this.textBoxName.Location = new System.Drawing.Point(166, 19);
|
||||||
this.textBoxName.Name = "textBoxName";
|
this.textBoxName.Name = "textBoxName";
|
||||||
this.textBoxName.Size = new System.Drawing.Size(282, 23);
|
this.textBoxName.Size = new System.Drawing.Size(282, 23);
|
||||||
this.textBoxName.TabIndex = 1;
|
this.textBoxName.TabIndex = 1;
|
||||||
//
|
//
|
||||||
// textBoxAddress
|
// textBoxAddress
|
||||||
//
|
//
|
||||||
this.textBoxAddress.Location = new System.Drawing.Point(168, 83);
|
this.textBoxAddress.Location = new System.Drawing.Point(166, 60);
|
||||||
this.textBoxAddress.Name = "textBoxAddress";
|
this.textBoxAddress.Name = "textBoxAddress";
|
||||||
this.textBoxAddress.Size = new System.Drawing.Size(282, 23);
|
this.textBoxAddress.Size = new System.Drawing.Size(282, 23);
|
||||||
this.textBoxAddress.TabIndex = 3;
|
this.textBoxAddress.TabIndex = 3;
|
||||||
@ -69,7 +71,7 @@
|
|||||||
// labelAddress
|
// labelAddress
|
||||||
//
|
//
|
||||||
this.labelAddress.AutoSize = true;
|
this.labelAddress.AutoSize = true;
|
||||||
this.labelAddress.Location = new System.Drawing.Point(37, 86);
|
this.labelAddress.Location = new System.Drawing.Point(35, 63);
|
||||||
this.labelAddress.Name = "labelAddress";
|
this.labelAddress.Name = "labelAddress";
|
||||||
this.labelAddress.Size = new System.Drawing.Size(40, 15);
|
this.labelAddress.Size = new System.Drawing.Size(40, 15);
|
||||||
this.labelAddress.TabIndex = 2;
|
this.labelAddress.TabIndex = 2;
|
||||||
@ -78,7 +80,7 @@
|
|||||||
// labelDate
|
// labelDate
|
||||||
//
|
//
|
||||||
this.labelDate.AutoSize = true;
|
this.labelDate.AutoSize = true;
|
||||||
this.labelDate.Location = new System.Drawing.Point(37, 128);
|
this.labelDate.Location = new System.Drawing.Point(35, 105);
|
||||||
this.labelDate.Name = "labelDate";
|
this.labelDate.Name = "labelDate";
|
||||||
this.labelDate.Size = new System.Drawing.Size(87, 15);
|
this.labelDate.Size = new System.Drawing.Size(87, 15);
|
||||||
this.labelDate.TabIndex = 4;
|
this.labelDate.TabIndex = 4;
|
||||||
@ -86,7 +88,7 @@
|
|||||||
//
|
//
|
||||||
// dateTimePicker
|
// dateTimePicker
|
||||||
//
|
//
|
||||||
this.dateTimePicker.Location = new System.Drawing.Point(168, 122);
|
this.dateTimePicker.Location = new System.Drawing.Point(166, 99);
|
||||||
this.dateTimePicker.Name = "dateTimePicker";
|
this.dateTimePicker.Name = "dateTimePicker";
|
||||||
this.dateTimePicker.Size = new System.Drawing.Size(282, 23);
|
this.dateTimePicker.Size = new System.Drawing.Size(282, 23);
|
||||||
this.dateTimePicker.TabIndex = 6;
|
this.dateTimePicker.TabIndex = 6;
|
||||||
@ -140,11 +142,29 @@
|
|||||||
this.Count.HeaderText = "Количество";
|
this.Count.HeaderText = "Количество";
|
||||||
this.Count.Name = "Count";
|
this.Count.Name = "Count";
|
||||||
//
|
//
|
||||||
|
// textBoxMaxCount
|
||||||
|
//
|
||||||
|
this.textBoxMaxCount.Location = new System.Drawing.Point(166, 138);
|
||||||
|
this.textBoxMaxCount.Name = "textBoxMaxCount";
|
||||||
|
this.textBoxMaxCount.Size = new System.Drawing.Size(282, 23);
|
||||||
|
this.textBoxMaxCount.TabIndex = 11;
|
||||||
|
//
|
||||||
|
// labelMaxCount
|
||||||
|
//
|
||||||
|
this.labelMaxCount.AutoSize = true;
|
||||||
|
this.labelMaxCount.Location = new System.Drawing.Point(35, 141);
|
||||||
|
this.labelMaxCount.Name = "labelMaxCount";
|
||||||
|
this.labelMaxCount.Size = new System.Drawing.Size(40, 15);
|
||||||
|
this.labelMaxCount.TabIndex = 10;
|
||||||
|
this.labelMaxCount.Text = "Адрес";
|
||||||
|
//
|
||||||
// FormShop
|
// FormShop
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(631, 530);
|
this.ClientSize = new System.Drawing.Size(631, 530);
|
||||||
|
this.Controls.Add(this.textBoxMaxCount);
|
||||||
|
this.Controls.Add(this.labelMaxCount);
|
||||||
this.Controls.Add(this.dataGridView1);
|
this.Controls.Add(this.dataGridView1);
|
||||||
this.Controls.Add(this.ButtonCancel);
|
this.Controls.Add(this.ButtonCancel);
|
||||||
this.Controls.Add(this.ButtonSave);
|
this.Controls.Add(this.ButtonSave);
|
||||||
@ -177,5 +197,7 @@
|
|||||||
private DataGridViewTextBoxColumn FurnitureId;
|
private DataGridViewTextBoxColumn FurnitureId;
|
||||||
private DataGridViewTextBoxColumn FurnitureName;
|
private DataGridViewTextBoxColumn FurnitureName;
|
||||||
private DataGridViewTextBoxColumn Count;
|
private DataGridViewTextBoxColumn Count;
|
||||||
|
private TextBox textBoxMaxCount;
|
||||||
|
private Label labelMaxCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -44,6 +44,13 @@ namespace FurnitureAssembly
|
|||||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Convert.ToInt32(textBoxMaxCount.Text) <= 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Некорректная вместимость", "Ошибка",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
_logger.LogInformation("Сохранение магазина");
|
_logger.LogInformation("Сохранение магазина");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -52,6 +59,7 @@ namespace FurnitureAssembly
|
|||||||
Id = _id ?? 0,
|
Id = _id ?? 0,
|
||||||
ShopName = textBoxName.Text,
|
ShopName = textBoxName.Text,
|
||||||
Address = textBoxAddress.Text,
|
Address = textBoxAddress.Text,
|
||||||
|
MaxCount = Convert.ToInt32(textBoxMaxCount.Text),
|
||||||
DateOpening = dateTimePicker.Value
|
DateOpening = dateTimePicker.Value
|
||||||
};
|
};
|
||||||
var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model);
|
var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model);
|
||||||
@ -94,6 +102,7 @@ namespace FurnitureAssembly
|
|||||||
textBoxName.Text = view.ShopName;
|
textBoxName.Text = view.ShopName;
|
||||||
textBoxAddress.Text = view.Address.ToString();
|
textBoxAddress.Text = view.Address.ToString();
|
||||||
dateTimePicker.Value = view.DateOpening;
|
dateTimePicker.Value = view.DateOpening;
|
||||||
|
textBoxMaxCount.Text = view.MaxCount.ToString();
|
||||||
_shopFurnitures = view.Furnitures ?? new
|
_shopFurnitures = view.Furnitures ?? new
|
||||||
Dictionary<int, (IFurnitureModel, int)>();
|
Dictionary<int, (IFurnitureModel, int)>();
|
||||||
LoadData();
|
LoadData();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user