Zhimolostnova A.V. Lab work 1 #2

Closed
AnnZhimol wants to merge 12 commits from LabRab_1 into main
15 changed files with 128 additions and 88 deletions
Showing only changes of commit b73d15d472 - Show all commits

View File

@ -11,6 +11,8 @@ namespace SofrwareInstallationContracts.ViewModels
{
public class OrderViewModel : IOrderModel
{
public int PackageId { get; set; }
[DisplayName("Количество")]
public int Count { get; set; }
@ -29,6 +31,5 @@ namespace SofrwareInstallationContracts.ViewModels
[DisplayName("Номер")]
public int Id { get; set; }
public int PackageId { get; set; }
}
}

View File

@ -33,7 +33,7 @@
this.CostLabel = new System.Windows.Forms.Label();
this.CostTextBox = new System.Windows.Forms.TextBox();
this.SaveButton = new System.Windows.Forms.Button();
this.CancelButton = new System.Windows.Forms.Button();
this.ButtonCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// ComponentNameLabel
@ -78,22 +78,22 @@
this.SaveButton.UseVisualStyleBackColor = true;
this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click);
//
// CancelButton
// ButtonCancel
//
this.CancelButton.Location = new System.Drawing.Point(224, 90);
this.CancelButton.Name = "CancelButton";
this.CancelButton.Size = new System.Drawing.Size(75, 23);
this.CancelButton.TabIndex = 6;
this.CancelButton.Text = "Отмена";
this.CancelButton.UseVisualStyleBackColor = true;
this.CancelButton.Click += new System.EventHandler(this.CancelButton_Click);
this.ButtonCancel.Location = new System.Drawing.Point(224, 90);
this.ButtonCancel.Name = "ButtonCancel";
this.ButtonCancel.Size = new System.Drawing.Size(75, 23);
this.ButtonCancel.TabIndex = 6;
this.ButtonCancel.Text = "Отмена";
this.ButtonCancel.UseVisualStyleBackColor = true;
this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click);
//
// FormComponent
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(328, 125);
this.Controls.Add(this.CancelButton);
this.Controls.Add(this.ButtonCancel);
this.Controls.Add(this.SaveButton);
this.Controls.Add(this.CostTextBox);
this.Controls.Add(this.CostLabel);
@ -113,6 +113,6 @@
private Label CostLabel;
private TextBox CostTextBox;
private Button SaveButton;
private Button CancelButton;
private Button ButtonCancel;
}
}

View File

@ -93,7 +93,7 @@ namespace SoftwareInstallationView
}
}
private void CancelButton_Click(object sender, EventArgs e)
private void ButtonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();

View File

@ -53,6 +53,7 @@
this.AddButton.TabIndex = 1;
this.AddButton.Text = "Добавить";
this.AddButton.UseVisualStyleBackColor = true;
this.AddButton.Click += new System.EventHandler(this.AddButton_Click);
//
// ChangeButton
//
@ -62,6 +63,7 @@
this.ChangeButton.TabIndex = 2;
this.ChangeButton.Text = "Изменить";
this.ChangeButton.UseVisualStyleBackColor = true;
this.ChangeButton.Click += new System.EventHandler(this.ChangeButton_Click);
//
// DeleteButton
//
@ -71,6 +73,7 @@
this.DeleteButton.TabIndex = 3;
this.DeleteButton.Text = "Удалить";
this.DeleteButton.UseVisualStyleBackColor = true;
this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click);
//
// UpdateButton
//
@ -80,6 +83,7 @@
this.UpdateButton.TabIndex = 4;
this.UpdateButton.Text = "Обновить";
this.UpdateButton.UseVisualStyleBackColor = true;
this.UpdateButton.Click += new System.EventHandler(this.UpdateButton_Click);
//
// FormComponents
//

View File

@ -34,7 +34,7 @@
this.PackageComboBox = new System.Windows.Forms.ComboBox();
this.CountTextBox = new System.Windows.Forms.TextBox();
this.SumTextBox = new System.Windows.Forms.TextBox();
this.CancelButton = new System.Windows.Forms.Button();
this.ButtonCancel = new System.Windows.Forms.Button();
this.SaveButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
@ -72,6 +72,7 @@
this.PackageComboBox.Name = "PackageComboBox";
this.PackageComboBox.Size = new System.Drawing.Size(201, 23);
this.PackageComboBox.TabIndex = 3;
this.PackageComboBox.SelectedIndexChanged += new System.EventHandler(this.PackageComboBox_SelectedIndexChanged);
//
// CountTextBox
//
@ -79,6 +80,7 @@
this.CountTextBox.Name = "CountTextBox";
this.CountTextBox.Size = new System.Drawing.Size(201, 23);
this.CountTextBox.TabIndex = 4;
this.CountTextBox.TextChanged += new System.EventHandler(this.CountTextBox_TextChanged);
//
// SumTextBox
//
@ -87,14 +89,15 @@
this.SumTextBox.Size = new System.Drawing.Size(201, 23);
this.SumTextBox.TabIndex = 5;
//
// CancelButton
// ButtonCancel
//
this.CancelButton.Location = new System.Drawing.Point(219, 113);
this.CancelButton.Name = "CancelButton";
this.CancelButton.Size = new System.Drawing.Size(75, 23);
this.CancelButton.TabIndex = 6;
this.CancelButton.Text = "Отменить";
this.CancelButton.UseVisualStyleBackColor = true;
this.ButtonCancel.Location = new System.Drawing.Point(219, 113);
this.ButtonCancel.Name = "ButtonCancel";
this.ButtonCancel.Size = new System.Drawing.Size(75, 23);
this.ButtonCancel.TabIndex = 6;
this.ButtonCancel.Text = "Отменить";
this.ButtonCancel.UseVisualStyleBackColor = true;
this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click);
//
// SaveButton
//
@ -104,6 +107,7 @@
this.SaveButton.TabIndex = 7;
this.SaveButton.Text = "Сохранить";
this.SaveButton.UseVisualStyleBackColor = true;
this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click);
//
// FormCreateOrder
//
@ -111,7 +115,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(309, 153);
this.Controls.Add(this.SaveButton);
this.Controls.Add(this.CancelButton);
this.Controls.Add(this.ButtonCancel);
this.Controls.Add(this.SumTextBox);
this.Controls.Add(this.CountTextBox);
this.Controls.Add(this.PackageComboBox);
@ -133,7 +137,7 @@
private ComboBox PackageComboBox;
private TextBox CountTextBox;
private TextBox SumTextBox;
private Button CancelButton;
private Button ButtonCancel;
private Button SaveButton;
}
}

View File

@ -128,7 +128,7 @@ namespace SoftwareInstallationView
}
}
private void CancelButton_Click(object sender, EventArgs e)
private void ButtonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();

View File

@ -64,14 +64,16 @@
// ИзделияToolStripMenuItem
//
this.ИзделияToolStripMenuItem.Name = "ИзделияToolStripMenuItem";
this.ИзделияToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ИзделияToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.ИзделияToolStripMenuItem.Text = "Изделия";
this.ИзделияToolStripMenuItem.Click += new System.EventHandler(this.ИзделияToolStripMenuItem_Click);
//
// КомпонентыToolStripMenuItem
//
this.КомпонентыToolStripMenuItem.Name = "КомпонентыToolStripMenuItem";
this.КомпонентыToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.КомпонентыToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.КомпонентыToolStripMenuItem.Text = "Компоненты";
this.КомпонентыToolStripMenuItem.Click += new System.EventHandler(this.КомпонентыToolStripMenuItem_Click);
//
// DataGridView
//
@ -90,6 +92,7 @@
this.CreateOrderButton.TabIndex = 2;
this.CreateOrderButton.Text = "Создать заказ";
this.CreateOrderButton.UseVisualStyleBackColor = true;
this.CreateOrderButton.Click += new System.EventHandler(this.CreateOrderButton_Click);
//
// TakeOrderInWorkButton
//
@ -99,6 +102,7 @@
this.TakeOrderInWorkButton.TabIndex = 3;
this.TakeOrderInWorkButton.Text = "Отдать на выполнение";
this.TakeOrderInWorkButton.UseVisualStyleBackColor = true;
this.TakeOrderInWorkButton.Click += new System.EventHandler(this.TakeOrderInWorkButton_Click);
//
// OrderReadyButton
//
@ -108,6 +112,7 @@
this.OrderReadyButton.TabIndex = 4;
this.OrderReadyButton.Text = "Заказ готов";
this.OrderReadyButton.UseVisualStyleBackColor = true;
this.OrderReadyButton.Click += new System.EventHandler(this.OrderReadyButton_Click);
//
// IssuedOrderButton
//
@ -117,6 +122,7 @@
this.IssuedOrderButton.TabIndex = 5;
this.IssuedOrderButton.Text = "Заказ выдан";
this.IssuedOrderButton.UseVisualStyleBackColor = true;
this.IssuedOrderButton.Click += new System.EventHandler(this.IssuedOrderButton_Click);
//
// UpdateListButton
//
@ -126,6 +132,7 @@
this.UpdateListButton.TabIndex = 6;
this.UpdateListButton.Text = "Обновить список";
this.UpdateListButton.UseVisualStyleBackColor = true;
this.UpdateListButton.Click += new System.EventHandler(this.UpdateListButton_Click);
//
// FormMain
//

View File

@ -1,6 +1,7 @@
using Microsoft.Extensions.Logging;
using SofrwareInstallationContracts.BindingModels;
using SofrwareInstallationContracts.BusinessLogicsContracts;
using SoftwareInstallationDataModels.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -96,7 +97,12 @@ namespace SoftwareInstallationView
{
var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel
{
Id = id
Id = id,
PackageId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["PackageId"].Value),
Status = Enum.Parse<OrderStatus>(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()),
Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value),
Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()),
DateCreate = DateTime.Parse(DataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()),
});
if (!operationResult)
@ -125,7 +131,12 @@ namespace SoftwareInstallationView
{
var operationResult = _orderLogic.FinishOrder(new OrderBindingModel
{
Id = id
Id = id,
PackageId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["PackageId"].Value),
Status = Enum.Parse<OrderStatus>(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()),
Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value),
Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()),
DateCreate = DateTime.Parse(DataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()),
});
if (!operationResult)
@ -154,7 +165,12 @@ namespace SoftwareInstallationView
{
var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel
{
Id = id
Id = id,
PackageId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["PackageId"].Value),
Status = Enum.Parse<OrderStatus>(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()),
Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value),
Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()),
DateCreate = DateTime.Parse(DataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()),
});
if (!operationResult)
@ -173,10 +189,9 @@ namespace SoftwareInstallationView
}
}
private void UpdateButton_Click(object sender, EventArgs e)
private void UpdateListButton_Click(object sender, EventArgs e)
{
LoadData();
}
}
}

View File

@ -28,9 +28,9 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
this.PackageNameLabel = new System.Windows.Forms.Label();
this.PriceLabel = new System.Windows.Forms.Label();
this.PackageNameTextBox = new System.Windows.Forms.TextBox();
@ -44,7 +44,7 @@
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ComponentNameField = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.CountField = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.CancelButton = new System.Windows.Forms.Button();
this.ButtonCancel = new System.Windows.Forms.Button();
this.SaveButton = new System.Windows.Forms.Button();
this.ComponentsGroupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DataGridView)).BeginInit();
@ -104,6 +104,7 @@
this.UpdateButton.TabIndex = 4;
this.UpdateButton.Text = "Обновить";
this.UpdateButton.UseVisualStyleBackColor = true;
this.UpdateButton.Click += new System.EventHandler(this.UpdateButton_Click);
//
// DeleteButton
//
@ -113,6 +114,7 @@
this.DeleteButton.TabIndex = 3;
this.DeleteButton.Text = "Удалить";
this.DeleteButton.UseVisualStyleBackColor = true;
this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click);
//
// ChangeButton
//
@ -122,6 +124,7 @@
this.ChangeButton.TabIndex = 2;
this.ChangeButton.Text = "Изменить";
this.ChangeButton.UseVisualStyleBackColor = true;
this.ChangeButton.Click += new System.EventHandler(this.ChangeButton_Click);
//
// AddButton
//
@ -131,40 +134,41 @@
this.AddButton.TabIndex = 1;
this.AddButton.Text = "Добавить";
this.AddButton.UseVisualStyleBackColor = true;
this.AddButton.Click += new System.EventHandler(this.AddButton_Click);
//
// DataGridView
//
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.DataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.DataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.DataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.ID,
this.ComponentNameField,
this.CountField});
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.DataGridView.DefaultCellStyle = dataGridViewCellStyle2;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle5.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.DataGridView.DefaultCellStyle = dataGridViewCellStyle5;
this.DataGridView.Location = new System.Drawing.Point(6, 22);
this.DataGridView.Name = "DataGridView";
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.DataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle6.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.DataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle6;
this.DataGridView.RowTemplate.Height = 25;
this.DataGridView.Size = new System.Drawing.Size(561, 322);
this.DataGridView.TabIndex = 0;
@ -186,14 +190,15 @@
this.CountField.HeaderText = "Количество";
this.CountField.Name = "CountField";
//
// CancelButton
// ButtonCancel
//
this.CancelButton.Location = new System.Drawing.Point(602, 446);
this.CancelButton.Name = "CancelButton";
this.CancelButton.Size = new System.Drawing.Size(110, 34);
this.CancelButton.TabIndex = 7;
this.CancelButton.Text = "Отмена";
this.CancelButton.UseVisualStyleBackColor = true;
this.ButtonCancel.Location = new System.Drawing.Point(602, 446);
this.ButtonCancel.Name = "ButtonCancel";
this.ButtonCancel.Size = new System.Drawing.Size(110, 34);
this.ButtonCancel.TabIndex = 7;
this.ButtonCancel.Text = "Отмена";
this.ButtonCancel.UseVisualStyleBackColor = true;
this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click);
//
// SaveButton
//
@ -203,6 +208,7 @@
this.SaveButton.TabIndex = 8;
this.SaveButton.Text = "Сохранить";
this.SaveButton.UseVisualStyleBackColor = true;
this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click);
//
// FormPackage
//
@ -210,7 +216,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(746, 498);
this.Controls.Add(this.SaveButton);
this.Controls.Add(this.CancelButton);
this.Controls.Add(this.ButtonCancel);
this.Controls.Add(this.ComponentsGroupBox);
this.Controls.Add(this.PriceTextBox);
this.Controls.Add(this.PackageNameTextBox);
@ -240,7 +246,7 @@
private DataGridViewTextBoxColumn ID;
private DataGridViewTextBoxColumn ComponentNameField;
private DataGridViewTextBoxColumn CountField;
private Button CancelButton;
private Button ButtonCancel;
private Button SaveButton;
}
}

View File

@ -141,7 +141,7 @@ namespace SoftwareInstallationView
}
}
private void DeleteButtonl_Click(object sender, EventArgs e)
private void DeleteButton_Click(object sender, EventArgs e)
{
if (DataGridView.SelectedRows.Count == 1)
{
@ -217,7 +217,7 @@ namespace SoftwareInstallationView
}
}
private void CancelButton_Click(object sender, EventArgs e)
private void ButtonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();

View File

@ -33,7 +33,7 @@
this.ComponentComboBox = new System.Windows.Forms.ComboBox();
this.CountTextBox = new System.Windows.Forms.TextBox();
this.SaveButton = new System.Windows.Forms.Button();
this.CancelButton = new System.Windows.Forms.Button();
this.ButtonCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// ComponentSelectLabel
@ -79,22 +79,22 @@
this.SaveButton.UseVisualStyleBackColor = true;
this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click);
//
// CancelButton
// ButtonCancel
//
this.CancelButton.Location = new System.Drawing.Point(222, 98);
this.CancelButton.Name = "CancelButton";
this.CancelButton.Size = new System.Drawing.Size(75, 23);
this.CancelButton.TabIndex = 5;
this.CancelButton.Text = "Отмена";
this.CancelButton.UseVisualStyleBackColor = true;
this.CancelButton.Click += new System.EventHandler(this.CancelButton_Click);
this.ButtonCancel.Location = new System.Drawing.Point(222, 98);
this.ButtonCancel.Name = "ButtonCancel";
this.ButtonCancel.Size = new System.Drawing.Size(75, 23);
this.ButtonCancel.TabIndex = 5;
this.ButtonCancel.Text = "Отмена";
this.ButtonCancel.UseVisualStyleBackColor = true;
this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click);
//
// FormPackageComponent
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(337, 141);
this.Controls.Add(this.CancelButton);
this.Controls.Add(this.ButtonCancel);
this.Controls.Add(this.SaveButton);
this.Controls.Add(this.CountTextBox);
this.Controls.Add(this.ComponentComboBox);
@ -114,6 +114,6 @@
private ComboBox ComponentComboBox;
private TextBox CountTextBox;
private Button SaveButton;
private Button CancelButton;
private Button ButtonCancel;
}
}

View File

@ -86,7 +86,7 @@ namespace SoftwareInstallationView
Close();
}
private void CancelButton_Click(object sender, EventArgs e)
private void ButtonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();

View File

@ -53,6 +53,7 @@
this.AddButton.TabIndex = 1;
this.AddButton.Text = "Добавить";
this.AddButton.UseVisualStyleBackColor = true;
this.AddButton.Click += new System.EventHandler(this.AddButton_Click);
//
// ChangeButton
//
@ -62,6 +63,7 @@
this.ChangeButton.TabIndex = 2;
this.ChangeButton.Text = "Изменить";
this.ChangeButton.UseVisualStyleBackColor = true;
this.ChangeButton.Click += new System.EventHandler(this.ChangeButton_Click);
//
// DeleteButton
//
@ -71,6 +73,7 @@
this.DeleteButton.TabIndex = 3;
this.DeleteButton.Text = "Удалить";
this.DeleteButton.UseVisualStyleBackColor = true;
this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click);
//
// UpdateButton
//
@ -80,6 +83,7 @@
this.UpdateButton.TabIndex = 4;
this.UpdateButton.Text = "Обновить";
this.UpdateButton.UseVisualStyleBackColor = true;
this.UpdateButton.Click += new System.EventHandler(this.UpdateButton_Click);
//
// FormPackages
//

View File

@ -41,14 +41,15 @@ namespace SoftwareInstallationView
DataGridView.DataSource = list;
DataGridView.Columns["Id"].Visible = false;
DataGridView.Columns["PackageName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
DataGridView.Columns["PackageComponents"].Visible = false;
}
_logger.LogInformation("Загрузка компонентов");
_logger.LogInformation("Загрузка изделий");
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки компонентов");
_logger.LogError(ex, "Ошибка загрузки изделий");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@ -89,7 +90,7 @@ namespace SoftwareInstallationView
if (MessageBox.Show("Удалить запись?", "Вопрос", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
int id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value);
_logger.LogInformation("Удаление компонента");
_logger.LogInformation("Удаление изделия");
try
{
@ -105,7 +106,7 @@ namespace SoftwareInstallationView
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка удаления компонента");
_logger.LogError(ex, "Ошибка удаления изделия");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

View File

@ -2,8 +2,6 @@ using SoftwareInstallationBusinessLogic.BusinessLogic;
using Microsoft.Extensions.DependencyInjection;
using SofrwareInstallationContracts.BusinessLogicsContracts;
using SofrwareInstallationContracts.StoragesContracts;
using SoftwareInstallationView;
using System.Drawing;
using SoftwareInstallationListImplement.Implements;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;