лаба 6 вроде готовая
This commit is contained in:
parent
f367e8f391
commit
686c850a1f
@ -20,11 +20,11 @@ namespace ConfectioneryContracts.ViewModels
|
|||||||
|
|
||||||
[DisplayName("ФИО клиента")]
|
[DisplayName("ФИО клиента")]
|
||||||
public string ClientFIO { get; set; } = string.Empty;
|
public string ClientFIO { get; set; } = string.Empty;
|
||||||
[DisplayName("Количество")]
|
|
||||||
public int? ImplementerId { get; set; }
|
public int? ImplementerId { get; set; }
|
||||||
|
|
||||||
[DisplayName("ФИО исполнителя")]
|
[DisplayName("ФИО исполнителя")]
|
||||||
public string ImplementerFIO { get; set; } = string.Empty;
|
public string ImplementerFIO { get; set; } = string.Empty;
|
||||||
|
[DisplayName("Количество")]
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
[DisplayName("Сумма")]
|
[DisplayName("Сумма")]
|
||||||
public double Sum { get; set; }
|
public double Sum { get; set; }
|
||||||
|
53
Confectionery/ConfectioneryView/FormMain.Designer.cs
generated
53
Confectionery/ConfectioneryView/FormMain.Designer.cs
generated
@ -33,6 +33,7 @@
|
|||||||
this.компонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.компонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.изделияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.изделияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.клиентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.клиентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.исполнителиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.отчетыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.отчетыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.списокКомпонентовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.списокКомпонентовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.компонентыПоИзделиямToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.компонентыПоИзделиямToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
@ -40,11 +41,8 @@
|
|||||||
this.запускРаботToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.запускРаботToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.dataGridView = new System.Windows.Forms.DataGridView();
|
this.dataGridView = new System.Windows.Forms.DataGridView();
|
||||||
this.ButtonCreateOrder = new System.Windows.Forms.Button();
|
this.ButtonCreateOrder = new System.Windows.Forms.Button();
|
||||||
this.ButtonTakeOrderInWork = new System.Windows.Forms.Button();
|
|
||||||
this.ButtonOrderReady = new System.Windows.Forms.Button();
|
|
||||||
this.ButtonIssuedOrder = new System.Windows.Forms.Button();
|
this.ButtonIssuedOrder = new System.Windows.Forms.Button();
|
||||||
this.ButtonRef = new System.Windows.Forms.Button();
|
this.ButtonRef = new System.Windows.Forms.Button();
|
||||||
this.исполнителиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.menuStrip.SuspendLayout();
|
this.menuStrip.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
@ -76,24 +74,31 @@
|
|||||||
// компонентыToolStripMenuItem
|
// компонентыToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem";
|
this.компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem";
|
||||||
this.компонентыToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
this.компонентыToolStripMenuItem.Size = new System.Drawing.Size(185, 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
|
||||||
//
|
//
|
||||||
this.изделияToolStripMenuItem.Name = "изделияToolStripMenuItem";
|
this.изделияToolStripMenuItem.Name = "изделияToolStripMenuItem";
|
||||||
this.изделияToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
this.изделияToolStripMenuItem.Size = new System.Drawing.Size(185, 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
|
||||||
//
|
//
|
||||||
this.клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem";
|
this.клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem";
|
||||||
this.клиентыToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
this.клиентыToolStripMenuItem.Size = new System.Drawing.Size(185, 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
|
||||||
|
//
|
||||||
|
this.исполнителиToolStripMenuItem.Name = "исполнителиToolStripMenuItem";
|
||||||
|
this.исполнителиToolStripMenuItem.Size = new System.Drawing.Size(185, 26);
|
||||||
|
this.исполнителиToolStripMenuItem.Text = "Исполнители";
|
||||||
|
this.исполнителиToolStripMenuItem.Click += new System.EventHandler(this.исполнителиToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// отчетыToolStripMenuItem
|
// отчетыToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.отчетыToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.отчетыToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
@ -134,6 +139,7 @@
|
|||||||
//
|
//
|
||||||
// dataGridView
|
// dataGridView
|
||||||
//
|
//
|
||||||
|
this.dataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.dataGridView.Location = new System.Drawing.Point(13, 31);
|
this.dataGridView.Location = new System.Drawing.Point(13, 31);
|
||||||
this.dataGridView.Name = "dataGridView";
|
this.dataGridView.Name = "dataGridView";
|
||||||
@ -152,29 +158,9 @@
|
|||||||
this.ButtonCreateOrder.UseVisualStyleBackColor = true;
|
this.ButtonCreateOrder.UseVisualStyleBackColor = true;
|
||||||
this.ButtonCreateOrder.Click += new System.EventHandler(this.ButtonCreateOrder_Click);
|
this.ButtonCreateOrder.Click += new System.EventHandler(this.ButtonCreateOrder_Click);
|
||||||
//
|
//
|
||||||
// ButtonTakeOrderInWork
|
|
||||||
//
|
|
||||||
this.ButtonTakeOrderInWork.Location = new System.Drawing.Point(1050, 164);
|
|
||||||
this.ButtonTakeOrderInWork.Name = "ButtonTakeOrderInWork";
|
|
||||||
this.ButtonTakeOrderInWork.Size = new System.Drawing.Size(246, 29);
|
|
||||||
this.ButtonTakeOrderInWork.TabIndex = 3;
|
|
||||||
this.ButtonTakeOrderInWork.Text = "Отдать на выполнение";
|
|
||||||
this.ButtonTakeOrderInWork.UseVisualStyleBackColor = true;
|
|
||||||
this.ButtonTakeOrderInWork.Click += new System.EventHandler(this.ButtonTakeOrderInWork_Click);
|
|
||||||
//
|
|
||||||
// ButtonOrderReady
|
|
||||||
//
|
|
||||||
this.ButtonOrderReady.Location = new System.Drawing.Point(1050, 256);
|
|
||||||
this.ButtonOrderReady.Name = "ButtonOrderReady";
|
|
||||||
this.ButtonOrderReady.Size = new System.Drawing.Size(246, 29);
|
|
||||||
this.ButtonOrderReady.TabIndex = 4;
|
|
||||||
this.ButtonOrderReady.Text = "Заказ готов";
|
|
||||||
this.ButtonOrderReady.UseVisualStyleBackColor = true;
|
|
||||||
this.ButtonOrderReady.Click += new System.EventHandler(this.ButtonOrderReady_Click);
|
|
||||||
//
|
|
||||||
// ButtonIssuedOrder
|
// ButtonIssuedOrder
|
||||||
//
|
//
|
||||||
this.ButtonIssuedOrder.Location = new System.Drawing.Point(1050, 351);
|
this.ButtonIssuedOrder.Location = new System.Drawing.Point(1050, 135);
|
||||||
this.ButtonIssuedOrder.Name = "ButtonIssuedOrder";
|
this.ButtonIssuedOrder.Name = "ButtonIssuedOrder";
|
||||||
this.ButtonIssuedOrder.Size = new System.Drawing.Size(246, 29);
|
this.ButtonIssuedOrder.Size = new System.Drawing.Size(246, 29);
|
||||||
this.ButtonIssuedOrder.TabIndex = 5;
|
this.ButtonIssuedOrder.TabIndex = 5;
|
||||||
@ -184,7 +170,7 @@
|
|||||||
//
|
//
|
||||||
// ButtonRef
|
// ButtonRef
|
||||||
//
|
//
|
||||||
this.ButtonRef.Location = new System.Drawing.Point(1050, 441);
|
this.ButtonRef.Location = new System.Drawing.Point(1050, 198);
|
||||||
this.ButtonRef.Name = "ButtonRef";
|
this.ButtonRef.Name = "ButtonRef";
|
||||||
this.ButtonRef.Size = new System.Drawing.Size(246, 29);
|
this.ButtonRef.Size = new System.Drawing.Size(246, 29);
|
||||||
this.ButtonRef.TabIndex = 6;
|
this.ButtonRef.TabIndex = 6;
|
||||||
@ -192,13 +178,6 @@
|
|||||||
this.ButtonRef.UseVisualStyleBackColor = true;
|
this.ButtonRef.UseVisualStyleBackColor = true;
|
||||||
this.ButtonRef.Click += new System.EventHandler(this.ButtonRef_Click);
|
this.ButtonRef.Click += new System.EventHandler(this.ButtonRef_Click);
|
||||||
//
|
//
|
||||||
// исполнителиToolStripMenuItem
|
|
||||||
//
|
|
||||||
this.исполнителиToolStripMenuItem.Name = "исполнителиToolStripMenuItem";
|
|
||||||
this.исполнителиToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
|
||||||
this.исполнителиToolStripMenuItem.Text = "Исполнители";
|
|
||||||
this.исполнителиToolStripMenuItem.Click += new System.EventHandler(this.исполнителиToolStripMenuItem_Click);
|
|
||||||
//
|
|
||||||
// FormMain
|
// FormMain
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||||
@ -206,8 +185,6 @@
|
|||||||
this.ClientSize = new System.Drawing.Size(1376, 569);
|
this.ClientSize = new System.Drawing.Size(1376, 569);
|
||||||
this.Controls.Add(this.ButtonRef);
|
this.Controls.Add(this.ButtonRef);
|
||||||
this.Controls.Add(this.ButtonIssuedOrder);
|
this.Controls.Add(this.ButtonIssuedOrder);
|
||||||
this.Controls.Add(this.ButtonOrderReady);
|
|
||||||
this.Controls.Add(this.ButtonTakeOrderInWork);
|
|
||||||
this.Controls.Add(this.ButtonCreateOrder);
|
this.Controls.Add(this.ButtonCreateOrder);
|
||||||
this.Controls.Add(this.dataGridView);
|
this.Controls.Add(this.dataGridView);
|
||||||
this.Controls.Add(this.menuStrip);
|
this.Controls.Add(this.menuStrip);
|
||||||
@ -231,8 +208,6 @@
|
|||||||
private ToolStripMenuItem изделияToolStripMenuItem;
|
private ToolStripMenuItem изделияToolStripMenuItem;
|
||||||
private DataGridView dataGridView;
|
private DataGridView dataGridView;
|
||||||
private Button ButtonCreateOrder;
|
private Button ButtonCreateOrder;
|
||||||
private Button ButtonTakeOrderInWork;
|
|
||||||
private Button ButtonOrderReady;
|
|
||||||
private Button ButtonIssuedOrder;
|
private Button ButtonIssuedOrder;
|
||||||
private Button ButtonRef;
|
private Button ButtonRef;
|
||||||
private ToolStripMenuItem отчетыToolStripMenuItem;
|
private ToolStripMenuItem отчетыToolStripMenuItem;
|
||||||
|
@ -133,58 +133,6 @@ namespace ConfectioneryView
|
|||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void ButtonTakeOrderInWork_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (dataGridView.SelectedRows.Count == 1)
|
|
||||||
{
|
|
||||||
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
|
||||||
_logger.LogInformation("Заказ №{id}. Меняется статус на 'В работе'", id);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var operationResult = _orderLogic.TakeOrderInWork(new
|
|
||||||
OrderBindingModel
|
|
||||||
{ Id = id });
|
|
||||||
if (!operationResult)
|
|
||||||
{
|
|
||||||
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
|
|
||||||
}
|
|
||||||
LoadData();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Ошибка передачи заказа в работу");
|
|
||||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
|
|
||||||
MessageBoxIcon.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ButtonOrderReady_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (dataGridView.SelectedRows.Count == 1)
|
|
||||||
{
|
|
||||||
int id =
|
|
||||||
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
|
||||||
_logger.LogInformation("Заказ №{id}. Меняется статус на 'Готов'",
|
|
||||||
id);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var operationResult = _orderLogic.FinishOrder(new
|
|
||||||
OrderBindingModel
|
|
||||||
{ Id = id });
|
|
||||||
if (!operationResult)
|
|
||||||
{
|
|
||||||
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
|
|
||||||
}
|
|
||||||
LoadData();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Ошибка отметки о готовности заказа");
|
|
||||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ButtonIssuedOrder_Click(object sender, EventArgs e)
|
private void ButtonIssuedOrder_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user