PIbd-22 Chubykina P.P. LabWork_01_Hard #6

Closed
chubykina_polina wants to merge 13 commits from LabWork_01_Hard into LabWork_01
5 changed files with 39 additions and 39 deletions
Showing only changes of commit 066a366922 - Show all commits

View File

@ -96,7 +96,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
}
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);
var shop = _shopStorage.GetElement(shopModel);
@ -107,9 +107,9 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
}
if (shop.ShopPastries.ContainsKey(Pastry.Id))
{
var shopIC = shop.ShopPastries[Pastry.Id];
shopIC.Item2 += count;
shop.ShopPastries[Pastry.Id] = shopIC;
var shopP = shop.ShopPastries[Pastry.Id];
shopP.Item2 += count;
shop.ShopPastries[Pastry.Id] = shopP;
_logger.LogInformation("Supply. Added {count} '{Pastry}' to '{ShopName}' shop", count, Pastry.PastryName,
shop.ShopName);
}

View File

@ -77,7 +77,7 @@
//
this.изделияToolStripMenuItem.Name = "изделияToolStripMenuItem";
this.изделияToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
this.изделияToolStripMenuItem.Text = "Изделия";
this.изделияToolStripMenuItem.Text = "Выпечка";
this.изделияToolStripMenuItem.Click += new System.EventHandler(this.ИзделияToolStripMenuItem_Click);
//
// магазиныToolStripMenuItem

View File

@ -36,11 +36,11 @@
this.labelName = new System.Windows.Forms.Label();
this.groupBoxPastries = new System.Windows.Forms.GroupBox();
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.ColumnName = 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();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.SuspendLayout();
@ -51,9 +51,9 @@
this.labelOpeningDate.Location = new System.Drawing.Point(31, 102);
this.labelOpeningDate.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
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.Text = "Дата открытия :";
this.labelOpeningDate.Text = "Дата открытия:";
//
// dateTimePicker
//
@ -77,9 +77,9 @@
this.labelAddress.Location = new System.Drawing.Point(31, 63);
this.labelAddress.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
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.Text = "Адрес :";
this.labelAddress.Text = "Адрес:";
//
// textBoxName
//
@ -95,9 +95,9 @@
this.labelName.Location = new System.Drawing.Point(31, 23);
this.labelName.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
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.Text = "Название :";
this.labelName.Text = "Название:";
//
// groupBoxPastries
//
@ -115,7 +115,7 @@
//
this.dataGridView.AllowUserToAddRows = 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.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.ColumnId,
@ -133,28 +133,6 @@
this.dataGridView.Size = new System.Drawing.Size(522, 356);
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
//
this.ColumnId.HeaderText = "Id";
@ -180,6 +158,28 @@
this.ColumnCount.ReadOnly = true;
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
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);

View File

@ -84,7 +84,7 @@
//
this.dataGridView.AllowUserToAddRows = 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.Dock = System.Windows.Forms.DockStyle.Left;
this.dataGridView.Location = new System.Drawing.Point(0, 0);

View File

@ -75,7 +75,7 @@ namespace ConfectioneryView
}
if (comboBoxPastry.SelectedValue == null)
{
MessageBox.Show("Выберите мороженое", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("Выберите выпечку", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (string.IsNullOrEmpty(textBoxCount.Text))
@ -90,7 +90,7 @@ namespace ConfectioneryView
{ Id = Convert.ToInt32(comboBoxPastry.SelectedValue) });
if (pastry == null)
{
throw new Exception("Мороженое не найдено.");
throw new Exception("Выпечка не найдена.");
}
var operationResult = _logicShop.Supply(new ShopSearchModel
{