вроде точно готовая лаба 1 хард
This commit is contained in:
parent
b6d44d2abd
commit
066a366922
@ -96,7 +96,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
|
|||||||
}
|
}
|
||||||
if (count <= 0)
|
if (count <= 0)
|
||||||
{
|
{
|
||||||
throw new ArgumentException("Количество товаров(мороженого) в магазине должно быть больше нуля", nameof(count));
|
throw new ArgumentException("Количество товаров(выпечки) в магазине должно быть больше нуля", nameof(count));
|
||||||
}
|
}
|
||||||
_logger.LogInformation("Supply(GetElement). ShopName: {ShopName}. Id: {Id}", shopModel.ShopName, shopModel.Id);
|
_logger.LogInformation("Supply(GetElement). ShopName: {ShopName}. Id: {Id}", shopModel.ShopName, shopModel.Id);
|
||||||
var shop = _shopStorage.GetElement(shopModel);
|
var shop = _shopStorage.GetElement(shopModel);
|
||||||
@ -107,9 +107,9 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
|
|||||||
}
|
}
|
||||||
if (shop.ShopPastries.ContainsKey(Pastry.Id))
|
if (shop.ShopPastries.ContainsKey(Pastry.Id))
|
||||||
{
|
{
|
||||||
var shopIC = shop.ShopPastries[Pastry.Id];
|
var shopP = shop.ShopPastries[Pastry.Id];
|
||||||
shopIC.Item2 += count;
|
shopP.Item2 += count;
|
||||||
shop.ShopPastries[Pastry.Id] = shopIC;
|
shop.ShopPastries[Pastry.Id] = shopP;
|
||||||
_logger.LogInformation("Supply. Added {count} '{Pastry}' to '{ShopName}' shop", count, Pastry.PastryName,
|
_logger.LogInformation("Supply. Added {count} '{Pastry}' to '{ShopName}' shop", count, Pastry.PastryName,
|
||||||
shop.ShopName);
|
shop.ShopName);
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
//
|
//
|
||||||
this.изделияToolStripMenuItem.Name = "изделияToolStripMenuItem";
|
this.изделияToolStripMenuItem.Name = "изделияToolStripMenuItem";
|
||||||
this.изделияToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
this.изделияToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
||||||
this.изделияToolStripMenuItem.Text = "Изделия";
|
this.изделияToolStripMenuItem.Text = "Выпечка";
|
||||||
this.изделияToolStripMenuItem.Click += new System.EventHandler(this.ИзделияToolStripMenuItem_Click);
|
this.изделияToolStripMenuItem.Click += new System.EventHandler(this.ИзделияToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// магазиныToolStripMenuItem
|
// магазиныToolStripMenuItem
|
||||||
|
62
Confectionery/ConfectioneryView/FormShop.Designer.cs
generated
62
Confectionery/ConfectioneryView/FormShop.Designer.cs
generated
@ -36,11 +36,11 @@
|
|||||||
this.labelName = new System.Windows.Forms.Label();
|
this.labelName = new System.Windows.Forms.Label();
|
||||||
this.groupBoxPastries = new System.Windows.Forms.GroupBox();
|
this.groupBoxPastries = new System.Windows.Forms.GroupBox();
|
||||||
this.dataGridView = new System.Windows.Forms.DataGridView();
|
this.dataGridView = new System.Windows.Forms.DataGridView();
|
||||||
this.buttonCancel = new System.Windows.Forms.Button();
|
|
||||||
this.buttonSave = new System.Windows.Forms.Button();
|
|
||||||
this.ColumnId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.ColumnId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
this.ColumnName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.ColumnName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
this.ColumnCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.ColumnCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.buttonCancel = new System.Windows.Forms.Button();
|
||||||
|
this.buttonSave = new System.Windows.Forms.Button();
|
||||||
this.groupBoxPastries.SuspendLayout();
|
this.groupBoxPastries.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
@ -51,9 +51,9 @@
|
|||||||
this.labelOpeningDate.Location = new System.Drawing.Point(31, 102);
|
this.labelOpeningDate.Location = new System.Drawing.Point(31, 102);
|
||||||
this.labelOpeningDate.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
this.labelOpeningDate.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||||
this.labelOpeningDate.Name = "labelOpeningDate";
|
this.labelOpeningDate.Name = "labelOpeningDate";
|
||||||
this.labelOpeningDate.Size = new System.Drawing.Size(117, 20);
|
this.labelOpeningDate.Size = new System.Drawing.Size(113, 20);
|
||||||
this.labelOpeningDate.TabIndex = 12;
|
this.labelOpeningDate.TabIndex = 12;
|
||||||
this.labelOpeningDate.Text = "Дата открытия :";
|
this.labelOpeningDate.Text = "Дата открытия:";
|
||||||
//
|
//
|
||||||
// dateTimePicker
|
// dateTimePicker
|
||||||
//
|
//
|
||||||
@ -77,9 +77,9 @@
|
|||||||
this.labelAddress.Location = new System.Drawing.Point(31, 63);
|
this.labelAddress.Location = new System.Drawing.Point(31, 63);
|
||||||
this.labelAddress.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
this.labelAddress.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||||
this.labelAddress.Name = "labelAddress";
|
this.labelAddress.Name = "labelAddress";
|
||||||
this.labelAddress.Size = new System.Drawing.Size(58, 20);
|
this.labelAddress.Size = new System.Drawing.Size(54, 20);
|
||||||
this.labelAddress.TabIndex = 9;
|
this.labelAddress.TabIndex = 9;
|
||||||
this.labelAddress.Text = "Адрес :";
|
this.labelAddress.Text = "Адрес:";
|
||||||
//
|
//
|
||||||
// textBoxName
|
// textBoxName
|
||||||
//
|
//
|
||||||
@ -95,9 +95,9 @@
|
|||||||
this.labelName.Location = new System.Drawing.Point(31, 23);
|
this.labelName.Location = new System.Drawing.Point(31, 23);
|
||||||
this.labelName.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
this.labelName.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||||
this.labelName.Name = "labelName";
|
this.labelName.Name = "labelName";
|
||||||
this.labelName.Size = new System.Drawing.Size(84, 20);
|
this.labelName.Size = new System.Drawing.Size(80, 20);
|
||||||
this.labelName.TabIndex = 7;
|
this.labelName.TabIndex = 7;
|
||||||
this.labelName.Text = "Название :";
|
this.labelName.Text = "Название:";
|
||||||
//
|
//
|
||||||
// groupBoxPastries
|
// groupBoxPastries
|
||||||
//
|
//
|
||||||
@ -115,7 +115,7 @@
|
|||||||
//
|
//
|
||||||
this.dataGridView.AllowUserToAddRows = false;
|
this.dataGridView.AllowUserToAddRows = false;
|
||||||
this.dataGridView.AllowUserToDeleteRows = false;
|
this.dataGridView.AllowUserToDeleteRows = false;
|
||||||
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
|
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ActiveBorder;
|
||||||
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||||
this.ColumnId,
|
this.ColumnId,
|
||||||
@ -133,28 +133,6 @@
|
|||||||
this.dataGridView.Size = new System.Drawing.Size(522, 356);
|
this.dataGridView.Size = new System.Drawing.Size(522, 356);
|
||||||
this.dataGridView.TabIndex = 0;
|
this.dataGridView.TabIndex = 0;
|
||||||
//
|
//
|
||||||
// buttonCancel
|
|
||||||
//
|
|
||||||
this.buttonCancel.Location = new System.Drawing.Point(449, 529);
|
|
||||||
this.buttonCancel.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
|
||||||
this.buttonCancel.Name = "buttonCancel";
|
|
||||||
this.buttonCancel.Size = new System.Drawing.Size(101, 36);
|
|
||||||
this.buttonCancel.TabIndex = 15;
|
|
||||||
this.buttonCancel.Text = "Отмена";
|
|
||||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
|
||||||
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancel_Click);
|
|
||||||
//
|
|
||||||
// buttonSave
|
|
||||||
//
|
|
||||||
this.buttonSave.Location = new System.Drawing.Point(330, 529);
|
|
||||||
this.buttonSave.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
|
||||||
this.buttonSave.Name = "buttonSave";
|
|
||||||
this.buttonSave.Size = new System.Drawing.Size(101, 36);
|
|
||||||
this.buttonSave.TabIndex = 14;
|
|
||||||
this.buttonSave.Text = "Сохранить";
|
|
||||||
this.buttonSave.UseVisualStyleBackColor = true;
|
|
||||||
this.buttonSave.Click += new System.EventHandler(this.ButtonSave_Click);
|
|
||||||
//
|
|
||||||
// ColumnId
|
// ColumnId
|
||||||
//
|
//
|
||||||
this.ColumnId.HeaderText = "Id";
|
this.ColumnId.HeaderText = "Id";
|
||||||
@ -180,6 +158,28 @@
|
|||||||
this.ColumnCount.ReadOnly = true;
|
this.ColumnCount.ReadOnly = true;
|
||||||
this.ColumnCount.Width = 125;
|
this.ColumnCount.Width = 125;
|
||||||
//
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
this.buttonCancel.Location = new System.Drawing.Point(449, 529);
|
||||||
|
this.buttonCancel.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||||
|
this.buttonCancel.Name = "buttonCancel";
|
||||||
|
this.buttonCancel.Size = new System.Drawing.Size(101, 36);
|
||||||
|
this.buttonCancel.TabIndex = 15;
|
||||||
|
this.buttonCancel.Text = "Отмена";
|
||||||
|
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancel_Click);
|
||||||
|
//
|
||||||
|
// buttonSave
|
||||||
|
//
|
||||||
|
this.buttonSave.Location = new System.Drawing.Point(330, 529);
|
||||||
|
this.buttonSave.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||||
|
this.buttonSave.Name = "buttonSave";
|
||||||
|
this.buttonSave.Size = new System.Drawing.Size(101, 36);
|
||||||
|
this.buttonSave.TabIndex = 14;
|
||||||
|
this.buttonSave.Text = "Сохранить";
|
||||||
|
this.buttonSave.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonSave.Click += new System.EventHandler(this.ButtonSave_Click);
|
||||||
|
//
|
||||||
// FormShop
|
// FormShop
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
//
|
//
|
||||||
this.dataGridView.AllowUserToAddRows = false;
|
this.dataGridView.AllowUserToAddRows = false;
|
||||||
this.dataGridView.AllowUserToDeleteRows = false;
|
this.dataGridView.AllowUserToDeleteRows = false;
|
||||||
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
|
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ActiveBorder;
|
||||||
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.dataGridView.Dock = System.Windows.Forms.DockStyle.Left;
|
this.dataGridView.Dock = System.Windows.Forms.DockStyle.Left;
|
||||||
this.dataGridView.Location = new System.Drawing.Point(0, 0);
|
this.dataGridView.Location = new System.Drawing.Point(0, 0);
|
||||||
|
@ -75,7 +75,7 @@ namespace ConfectioneryView
|
|||||||
}
|
}
|
||||||
if (comboBoxPastry.SelectedValue == null)
|
if (comboBoxPastry.SelectedValue == null)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Выберите мороженое", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show("Выберите выпечку", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (string.IsNullOrEmpty(textBoxCount.Text))
|
if (string.IsNullOrEmpty(textBoxCount.Text))
|
||||||
@ -90,7 +90,7 @@ namespace ConfectioneryView
|
|||||||
{ Id = Convert.ToInt32(comboBoxPastry.SelectedValue) });
|
{ Id = Convert.ToInt32(comboBoxPastry.SelectedValue) });
|
||||||
if (pastry == null)
|
if (pastry == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Мороженое не найдено.");
|
throw new Exception("Выпечка не найдена.");
|
||||||
}
|
}
|
||||||
var operationResult = _logicShop.Supply(new ShopSearchModel
|
var operationResult = _logicShop.Supply(new ShopSearchModel
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user