Удалены кнопки отдать на выполнение и готов
This commit is contained in:
parent
232c0f49dc
commit
11a9e9b806
224
Confectionery/FormMain.Designer.cs
generated
224
Confectionery/FormMain.Designer.cs
generated
@ -1,26 +1,26 @@
|
||||
namespace ConfectioneryView
|
||||
{
|
||||
partial class FormMain
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
partial class FormMain
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
@ -33,24 +33,22 @@
|
||||
pastryToolStripMenuItem = new ToolStripMenuItem();
|
||||
componentToolStripMenuItem = new ToolStripMenuItem();
|
||||
ShopsToolStripMenuItem = new ToolStripMenuItem();
|
||||
clientsToolStripMenuItem = new ToolStripMenuItem();
|
||||
ImplementersToolStripMenuItem = new ToolStripMenuItem();
|
||||
reportsToolStripMenuItem = new ToolStripMenuItem();
|
||||
reportShopsToolStripMenuItem = new ToolStripMenuItem();
|
||||
ShopPastriesToolStripMenuItem = new ToolStripMenuItem();
|
||||
groupOrdersToolStripMenuItem = new ToolStripMenuItem();
|
||||
pastriesToolStripMenuItem = new ToolStripMenuItem();
|
||||
pastryComponentsToolStripMenuItem = new ToolStripMenuItem();
|
||||
ordersToolStripMenuItem = new ToolStripMenuItem();
|
||||
groupOrdersToolStripMenuItem = new ToolStripMenuItem();
|
||||
pastriesToolStripMenuItem = new ToolStripMenuItem();
|
||||
pastryComponentsToolStripMenuItem = new ToolStripMenuItem();
|
||||
ordersToolStripMenuItem = new ToolStripMenuItem();
|
||||
DoWorkToolStripMenuItem = new ToolStripMenuItem();
|
||||
dataGridView = new DataGridView();
|
||||
buttonCreateOrder = new Button();
|
||||
buttonTakeOrderInWork = new Button();
|
||||
button2 = new Button();
|
||||
button3 = new Button();
|
||||
button4 = new Button();
|
||||
buttonAddPastryInShop = new Button();
|
||||
ImplementersToolStripMenuItem = new ToolStripMenuItem();
|
||||
DoWorkToolStripMenuItem = new ToolStripMenuItem();
|
||||
buttonSellPastry = new Button();
|
||||
clientsToolStripMenuItem = new ToolStripMenuItem();
|
||||
buttonSellPastry = new Button();
|
||||
menuStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
@ -74,73 +72,94 @@
|
||||
// pastryToolStripMenuItem
|
||||
//
|
||||
pastryToolStripMenuItem.Name = "pastryToolStripMenuItem";
|
||||
pastryToolStripMenuItem.Size = new Size(180, 22);
|
||||
pastryToolStripMenuItem.Size = new Size(149, 22);
|
||||
pastryToolStripMenuItem.Text = "Изделия";
|
||||
pastryToolStripMenuItem.Click += PastryToolStripMenuItem_Click;
|
||||
//
|
||||
// componentToolStripMenuItem
|
||||
//
|
||||
componentToolStripMenuItem.Name = "componentToolStripMenuItem";
|
||||
componentToolStripMenuItem.Size = new Size(180, 22);
|
||||
componentToolStripMenuItem.Size = new Size(149, 22);
|
||||
componentToolStripMenuItem.Text = "Компоненты";
|
||||
componentToolStripMenuItem.Click += ComponentsToolStripMenuItem_Click;
|
||||
//
|
||||
// ShopsToolStripMenuItem
|
||||
//
|
||||
ShopsToolStripMenuItem.Name = "ShopsToolStripMenuItem";
|
||||
ShopsToolStripMenuItem.Size = new Size(145, 22);
|
||||
ShopsToolStripMenuItem.Size = new Size(149, 22);
|
||||
ShopsToolStripMenuItem.Text = "Магазины";
|
||||
ShopsToolStripMenuItem.Click += ShopsToolStripMenuItem_Click;
|
||||
//
|
||||
// reportsToolStripMenuItem
|
||||
//
|
||||
reportsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { reportShopsToolStripMenuItem, ShopPastriesToolStripMenuItem, groupOrdersToolStripMenuItem, pastriesToolStripMenuItem, pastryComponentsToolStripMenuItem, ordersToolStripMenuItem });
|
||||
reportsToolStripMenuItem.Name = "reportsToolStripMenuItem";
|
||||
//
|
||||
// clientsToolStripMenuItem
|
||||
//
|
||||
clientsToolStripMenuItem.Name = "clientsToolStripMenuItem";
|
||||
clientsToolStripMenuItem.Size = new Size(149, 22);
|
||||
clientsToolStripMenuItem.Text = "Клиенты";
|
||||
clientsToolStripMenuItem.Click += ClientsToolStripMenuItem_Click;
|
||||
//
|
||||
// ImplementersToolStripMenuItem
|
||||
//
|
||||
ImplementersToolStripMenuItem.Name = "ImplementersToolStripMenuItem";
|
||||
ImplementersToolStripMenuItem.Size = new Size(149, 22);
|
||||
ImplementersToolStripMenuItem.Text = "Исполнители";
|
||||
ImplementersToolStripMenuItem.Click += ImplementersToolStripMenuItem_Click;
|
||||
//
|
||||
// reportsToolStripMenuItem
|
||||
//
|
||||
reportsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { reportShopsToolStripMenuItem, ShopPastriesToolStripMenuItem, groupOrdersToolStripMenuItem, pastriesToolStripMenuItem, pastryComponentsToolStripMenuItem, ordersToolStripMenuItem });
|
||||
reportsToolStripMenuItem.Name = "reportsToolStripMenuItem";
|
||||
reportsToolStripMenuItem.Size = new Size(60, 20);
|
||||
reportsToolStripMenuItem.Text = "Отчеты";
|
||||
//
|
||||
// reportShopsToolStripMenuItem
|
||||
//
|
||||
reportShopsToolStripMenuItem.Name = "reportShopsToolStripMenuItem";
|
||||
reportShopsToolStripMenuItem.Size = new Size(202, 22);
|
||||
reportShopsToolStripMenuItem.Size = new Size(215, 22);
|
||||
reportShopsToolStripMenuItem.Text = "Список магазинов";
|
||||
reportShopsToolStripMenuItem.Click += ReportShopsToolStripMenuItem_Click;
|
||||
//
|
||||
// ShopPastriesToolStripMenuItem
|
||||
//
|
||||
ShopPastriesToolStripMenuItem.Name = "ShopPastriesToolStripMenuItem";
|
||||
ShopPastriesToolStripMenuItem.Size = new Size(202, 22);
|
||||
ShopPastriesToolStripMenuItem.Size = new Size(215, 22);
|
||||
ShopPastriesToolStripMenuItem.Text = "Магазины с изделиями";
|
||||
ShopPastriesToolStripMenuItem.Click += ShopPastriesToolStripMenuItem_Click;
|
||||
//
|
||||
// groupOrdersToolStripMenuItem
|
||||
//
|
||||
groupOrdersToolStripMenuItem.Name = "groupOrdersToolStripMenuItem";
|
||||
groupOrdersToolStripMenuItem.Size = new Size(215, 22);
|
||||
groupOrdersToolStripMenuItem.Text = "Список групп заказов";
|
||||
groupOrdersToolStripMenuItem.Click += GroupOrdersToolStripMenuItem_Click;
|
||||
//
|
||||
// pastriesToolStripMenuItem
|
||||
//
|
||||
pastriesToolStripMenuItem.Name = "pastriesToolStripMenuItem";
|
||||
pastriesToolStripMenuItem.Size = new Size(215, 22);
|
||||
pastriesToolStripMenuItem.Text = "Список изделий";
|
||||
pastriesToolStripMenuItem.Click += PastriesToolStripMenuItem_Click;
|
||||
//
|
||||
// pastryComponentsToolStripMenuItem
|
||||
//
|
||||
pastryComponentsToolStripMenuItem.Name = "pastryComponentsToolStripMenuItem";
|
||||
pastryComponentsToolStripMenuItem.Size = new Size(215, 22);
|
||||
pastryComponentsToolStripMenuItem.Text = "Изделия с компонентами";
|
||||
pastryComponentsToolStripMenuItem.Click += PastryComponentsToolStripMenuItem_Click;
|
||||
//
|
||||
// ordersToolStripMenuItem
|
||||
//
|
||||
ordersToolStripMenuItem.Name = "ordersToolStripMenuItem";
|
||||
ordersToolStripMenuItem.Size = new Size(202, 22);
|
||||
//
|
||||
// groupOrdersToolStripMenuItem
|
||||
//
|
||||
groupOrdersToolStripMenuItem.Name = "groupOrdersToolStripMenuItem";
|
||||
groupOrdersToolStripMenuItem.Size = new Size(215, 22);
|
||||
groupOrdersToolStripMenuItem.Text = "Список групп заказов";
|
||||
groupOrdersToolStripMenuItem.Click += GroupOrdersToolStripMenuItem_Click;
|
||||
//
|
||||
// pastriesToolStripMenuItem
|
||||
//
|
||||
pastriesToolStripMenuItem.Name = "pastriesToolStripMenuItem";
|
||||
pastriesToolStripMenuItem.Size = new Size(215, 22);
|
||||
pastriesToolStripMenuItem.Text = "Список изделий";
|
||||
pastriesToolStripMenuItem.Click += PastriesToolStripMenuItem_Click;
|
||||
//
|
||||
// pastryComponentsToolStripMenuItem
|
||||
//
|
||||
pastryComponentsToolStripMenuItem.Name = "pastryComponentsToolStripMenuItem";
|
||||
pastryComponentsToolStripMenuItem.Size = new Size(215, 22);
|
||||
pastryComponentsToolStripMenuItem.Text = "Изделия с компонентами";
|
||||
pastryComponentsToolStripMenuItem.Click += PastryComponentsToolStripMenuItem_Click;
|
||||
//
|
||||
// ordersToolStripMenuItem
|
||||
//
|
||||
ordersToolStripMenuItem.Name = "ordersToolStripMenuItem";
|
||||
ordersToolStripMenuItem.Size = new Size(215, 22);
|
||||
ordersToolStripMenuItem.Text = "Список заказов";
|
||||
ordersToolStripMenuItem.Click += OrdersToolStripMenuItem_Click;
|
||||
//
|
||||
// DoWorkToolStripMenuItem
|
||||
//
|
||||
DoWorkToolStripMenuItem.Name = "DoWorkToolStripMenuItem";
|
||||
DoWorkToolStripMenuItem.Size = new Size(92, 20);
|
||||
DoWorkToolStripMenuItem.Text = "Запуск работ";
|
||||
DoWorkToolStripMenuItem.Click += DoWorkToolStripMenuItem_Click;
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
@ -162,32 +181,10 @@
|
||||
buttonCreateOrder.UseVisualStyleBackColor = true;
|
||||
buttonCreateOrder.Click += ButtonCreateOrder_Click;
|
||||
//
|
||||
// buttonTakeOrderInWork
|
||||
//
|
||||
buttonTakeOrderInWork.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
buttonTakeOrderInWork.Location = new Point(624, 98);
|
||||
buttonTakeOrderInWork.Name = "buttonTakeOrderInWork";
|
||||
buttonTakeOrderInWork.Size = new Size(147, 32);
|
||||
buttonTakeOrderInWork.TabIndex = 3;
|
||||
buttonTakeOrderInWork.Text = "Отдать на выполнение";
|
||||
buttonTakeOrderInWork.UseVisualStyleBackColor = true;
|
||||
buttonTakeOrderInWork.Click += ButtonTakeOrderInWork_Click;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
button2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
button2.Location = new Point(624, 157);
|
||||
button2.Name = "button2";
|
||||
button2.Size = new Size(147, 32);
|
||||
button2.TabIndex = 4;
|
||||
button2.Text = "Заказ готов";
|
||||
button2.UseVisualStyleBackColor = true;
|
||||
button2.Click += ButtonOrderReady_Click;
|
||||
//
|
||||
// button3
|
||||
//
|
||||
button3.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
button3.Location = new Point(624, 215);
|
||||
button3.Location = new Point(624, 95);
|
||||
button3.Name = "button3";
|
||||
button3.Size = new Size(147, 32);
|
||||
button3.TabIndex = 5;
|
||||
@ -198,7 +195,7 @@
|
||||
// button4
|
||||
//
|
||||
button4.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
button4.Location = new Point(624, 274);
|
||||
button4.Location = new Point(624, 154);
|
||||
button4.Name = "button4";
|
||||
button4.Size = new Size(147, 32);
|
||||
button4.TabIndex = 6;
|
||||
@ -216,24 +213,10 @@
|
||||
buttonAddPastryInShop.Text = "Пополнение магазина";
|
||||
buttonAddPastryInShop.UseVisualStyleBackColor = true;
|
||||
buttonAddPastryInShop.Click += ButtonAddPastryInShop_Click;
|
||||
//
|
||||
// ImplementersToolStripMenuItem
|
||||
//
|
||||
ImplementersToolStripMenuItem.Name = "ImplementersToolStripMenuItem";
|
||||
ImplementersToolStripMenuItem.Size = new Size(180, 22);
|
||||
ImplementersToolStripMenuItem.Text = "Исполнители";
|
||||
ImplementersToolStripMenuItem.Click += ImplementersToolStripMenuItem_Click;
|
||||
//
|
||||
// DoWorkToolStripMenuItem
|
||||
//
|
||||
DoWorkToolStripMenuItem.Name = "DoWorkToolStripMenuItem";
|
||||
DoWorkToolStripMenuItem.Size = new Size(92, 20);
|
||||
DoWorkToolStripMenuItem.Text = "Запуск работ";
|
||||
DoWorkToolStripMenuItem.Click += DoWorkToolStripMenuItem_Click;
|
||||
//
|
||||
// buttonSellPastry
|
||||
//
|
||||
buttonSellPastry.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
//
|
||||
// buttonSellPastry
|
||||
//
|
||||
buttonSellPastry.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
buttonSellPastry.Location = new Point(624, 331);
|
||||
buttonSellPastry.Name = "buttonSellPastry";
|
||||
buttonSellPastry.Size = new Size(147, 31);
|
||||
@ -242,13 +225,6 @@
|
||||
buttonSellPastry.UseVisualStyleBackColor = true;
|
||||
buttonSellPastry.Click += ButtonSellPastry_Click;
|
||||
//
|
||||
// clientsToolStripMenuItem
|
||||
//
|
||||
clientsToolStripMenuItem.Name = "clientsToolStripMenuItem";
|
||||
clientsToolStripMenuItem.Size = new Size(180, 22);
|
||||
clientsToolStripMenuItem.Text = "Клиенты";
|
||||
clientsToolStripMenuItem.Click += ClientsToolStripMenuItem_Click;
|
||||
//
|
||||
// FormMain
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
@ -258,8 +234,6 @@
|
||||
Controls.Add(buttonAddPastryInShop);
|
||||
Controls.Add(button4);
|
||||
Controls.Add(button3);
|
||||
Controls.Add(button2);
|
||||
Controls.Add(buttonTakeOrderInWork);
|
||||
Controls.Add(buttonCreateOrder);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(menuStrip1);
|
||||
@ -274,14 +248,12 @@
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
private MenuStrip menuStrip1;
|
||||
private ToolStripMenuItem справочникиToolStripMenuItem;
|
||||
private DataGridView dataGridView;
|
||||
private Button buttonCreateOrder;
|
||||
private Button buttonTakeOrderInWork;
|
||||
private Button button2;
|
||||
private Button button3;
|
||||
private Button button4;
|
||||
private ToolStripMenuItem pastryToolStripMenuItem;
|
||||
@ -291,13 +263,13 @@
|
||||
private ToolStripMenuItem ShopPastriesToolStripMenuItem;
|
||||
private ToolStripMenuItem groupOrdersToolStripMenuItem;
|
||||
private ToolStripMenuItem ShopsToolStripMenuItem;
|
||||
private ToolStripMenuItem pastriesToolStripMenuItem;
|
||||
private ToolStripMenuItem pastryComponentsToolStripMenuItem;
|
||||
private ToolStripMenuItem ordersToolStripMenuItem;
|
||||
private ToolStripMenuItem clientsToolStripMenuItem;
|
||||
private ToolStripMenuItem pastriesToolStripMenuItem;
|
||||
private ToolStripMenuItem pastryComponentsToolStripMenuItem;
|
||||
private ToolStripMenuItem ordersToolStripMenuItem;
|
||||
private ToolStripMenuItem clientsToolStripMenuItem;
|
||||
private Button buttonAddPastryInShop;
|
||||
private Button buttonSellPastry;
|
||||
private ToolStripMenuItem ImplementersToolStripMenuItem;
|
||||
private ToolStripMenuItem DoWorkToolStripMenuItem;
|
||||
}
|
||||
private ToolStripMenuItem ImplementersToolStripMenuItem;
|
||||
private ToolStripMenuItem DoWorkToolStripMenuItem;
|
||||
}
|
||||
}
|
@ -7,268 +7,218 @@ using System.Windows.Forms;
|
||||
|
||||
namespace ConfectioneryView
|
||||
{
|
||||
public partial class FormMain : Form
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly IOrderLogic _orderLogic;
|
||||
private readonly IReportLogic _reportLogic;
|
||||
private readonly IWorkProcess _workProcess;
|
||||
public partial class FormMain : Form
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly IOrderLogic _orderLogic;
|
||||
private readonly IReportLogic _reportLogic;
|
||||
private readonly IWorkProcess _workProcess;
|
||||
|
||||
public FormMain(ILogger<FormMain> logger, IOrderLogic orderLogic, IReportLogic reportLogic, IWorkProcess workProcess)
|
||||
{
|
||||
InitializeComponent();
|
||||
_logger = logger;
|
||||
_orderLogic = orderLogic;
|
||||
_reportLogic = reportLogic;
|
||||
_workProcess = workProcess;
|
||||
}
|
||||
private void FormMain_Load(object sender, EventArgs e)
|
||||
{
|
||||
LoadData();
|
||||
}
|
||||
private void LoadData()
|
||||
{
|
||||
try
|
||||
{
|
||||
var list = _orderLogic.ReadList(null);
|
||||
if (list != null)
|
||||
{
|
||||
dataGridView.DataSource = list;
|
||||
dataGridView.Columns["Id"].HeaderText = "Íîìåð çàêàçà";
|
||||
dataGridView.Columns["PastryId"].Visible = false;
|
||||
dataGridView.Columns["ClientId"].Visible = false;
|
||||
dataGridView.Columns["ImplementerId"].Visible = false;
|
||||
dataGridView.Columns["PastryName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
dataGridView.Columns["ClientFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
dataGridView.Columns["ImplementerFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
}
|
||||
_logger.LogInformation("Çàãðóçêà çàêàçîâ");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Îøèáêà çàãðóçêè çàêàçîâ");
|
||||
MessageBox.Show(ex.Message, "Îøèáêà", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
private void ComponentsToolStripMenuItem_Click(object sender, EventArgs
|
||||
e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormComponents));
|
||||
if (service is FormComponents form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
private void PastryToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormViewPastry));
|
||||
if (service is FormViewPastry form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
public FormMain(ILogger<FormMain> logger, IOrderLogic orderLogic, IReportLogic reportLogic, IWorkProcess workProcess)
|
||||
{
|
||||
InitializeComponent();
|
||||
_logger = logger;
|
||||
_orderLogic = orderLogic;
|
||||
_reportLogic = reportLogic;
|
||||
_workProcess = workProcess;
|
||||
}
|
||||
private void FormMain_Load(object sender, EventArgs e)
|
||||
{
|
||||
LoadData();
|
||||
}
|
||||
private void LoadData()
|
||||
{
|
||||
try
|
||||
{
|
||||
var list = _orderLogic.ReadList(null);
|
||||
if (list != null)
|
||||
{
|
||||
dataGridView.DataSource = list;
|
||||
dataGridView.Columns["Id"].HeaderText = "Íîìåð çàêàçà";
|
||||
dataGridView.Columns["PastryId"].Visible = false;
|
||||
dataGridView.Columns["ClientId"].Visible = false;
|
||||
dataGridView.Columns["ImplementerId"].Visible = false;
|
||||
dataGridView.Columns["PastryName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
dataGridView.Columns["ClientFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
dataGridView.Columns["ImplementerFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
}
|
||||
_logger.LogInformation("Çàãðóçêà çàêàçîâ");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Îøèáêà çàãðóçêè çàêàçîâ");
|
||||
MessageBox.Show(ex.Message, "Îøèáêà", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
private void ComponentsToolStripMenuItem_Click(object sender, EventArgs
|
||||
e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormComponents));
|
||||
if (service is FormComponents form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
private void PastryToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormViewPastry));
|
||||
if (service is FormViewPastry form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonCreateOrder_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder));
|
||||
if (service is FormCreateOrder form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
LoadData();
|
||||
}
|
||||
}
|
||||
private void ButtonCreateOrder_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder));
|
||||
if (service is FormCreateOrder form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
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("Çàêàç No{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);
|
||||
OrderStatus orderStatus = (OrderStatus)dataGridView.SelectedRows[0].Cells["Status"].Value;
|
||||
_logger.LogInformation("Çàêàç No{id}. Ìåíÿåòñÿ ñòàòóñ íà 'Ãîòîâ'", id);
|
||||
try
|
||||
{
|
||||
var operationResult = _orderLogic.FinishOrder(new OrderBindingModel
|
||||
{
|
||||
Id = id,
|
||||
Status = orderStatus
|
||||
});
|
||||
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)
|
||||
{
|
||||
if (dataGridView.SelectedRows.Count == 1)
|
||||
{
|
||||
int id =
|
||||
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
_logger.LogInformation("Çàêàç No{id}. Ìåíÿåòñÿ ñòàòóñ íà 'Âûäàí'", id);
|
||||
try
|
||||
{
|
||||
var operationResult = _orderLogic.DeliveryOrder(new
|
||||
OrderBindingModel
|
||||
{ Id = id });
|
||||
if (!operationResult)
|
||||
{
|
||||
throw new Exception("Îøèáêà ïðè ñîõðàíåíèè.Äîïîëíèòåëüíàÿ èíôîðìàöèÿ â ëîãàõ.");
|
||||
}
|
||||
_logger.LogInformation("Çàêàç No{id} âûäàí", id);
|
||||
LoadData();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Îøèáêà îòìåòêè î âûäà÷è çàêàçà");
|
||||
MessageBox.Show(ex.Message, "Îøèáêà", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void ButtonRef_Click(object sender, EventArgs e)
|
||||
{
|
||||
LoadData();
|
||||
}
|
||||
private void ButtonIssuedOrder_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataGridView.SelectedRows.Count == 1)
|
||||
{
|
||||
int id =
|
||||
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
_logger.LogInformation("Çàêàç No{id}. Ìåíÿåòñÿ ñòàòóñ íà 'Âûäàí'", id);
|
||||
try
|
||||
{
|
||||
var operationResult = _orderLogic.DeliveryOrder(new
|
||||
OrderBindingModel
|
||||
{ Id = id });
|
||||
if (!operationResult)
|
||||
{
|
||||
throw new Exception("Îøèáêà ïðè ñîõðàíåíèè.Äîïîëíèòåëüíàÿ èíôîðìàöèÿ â ëîãàõ.");
|
||||
}
|
||||
_logger.LogInformation("Çàêàç No{id} âûäàí", id);
|
||||
LoadData();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Îøèáêà îòìåòêè î âûäà÷è çàêàçà");
|
||||
MessageBox.Show(ex.Message, "Îøèáêà", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void ButtonRef_Click(object sender, EventArgs e)
|
||||
{
|
||||
LoadData();
|
||||
}
|
||||
|
||||
private void ReportShopsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
|
||||
if (dialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
_reportLogic.SaveShopsTableToWordFile(new ReportBindingModel { FileName = dialog.FileName });
|
||||
MessageBox.Show("Âûïîëíåíî", "Óñïåõ", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
private void ReportShopsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
|
||||
if (dialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
_reportLogic.SaveShopsTableToWordFile(new ReportBindingModel { FileName = dialog.FileName });
|
||||
MessageBox.Show("Âûïîëíåíî", "Óñïåõ", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
|
||||
private void PastriesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
|
||||
if (dialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
_reportLogic.SavePastriesToWordFile(new ReportBindingModel { FileName = dialog.FileName });
|
||||
MessageBox.Show("Âûïîëíåíî", "Óñïåõ", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
private void PastriesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
|
||||
if (dialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
_reportLogic.SavePastriesToWordFile(new ReportBindingModel { FileName = dialog.FileName });
|
||||
MessageBox.Show("Âûïîëíåíî", "Óñïåõ", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShopPastriesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormReportShopPastries));
|
||||
if (service is FormReportShopPastries form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
private void ShopPastriesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormReportShopPastries));
|
||||
if (service is FormReportShopPastries form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void PastryComponentsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormReportPastryComponents));
|
||||
if (service is FormReportPastryComponents form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
private void PastryComponentsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormReportPastryComponents));
|
||||
if (service is FormReportPastryComponents form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void GroupOrdersToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupOrders));
|
||||
if (service is FormReportGroupOrders form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
private void GroupOrdersToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupOrders));
|
||||
if (service is FormReportGroupOrders form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void OrdersToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders));
|
||||
if (service is FormReportOrders form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
private void OrdersToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders));
|
||||
if (service is FormReportOrders form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void ShopsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormViewShops));
|
||||
if (service is FormViewShops form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
private void ShopsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormViewShops));
|
||||
if (service is FormViewShops form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonAddPastryInShop_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormAddPastryInShop));
|
||||
if (service is FormAddPastryInShop form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
private void ButtonAddPastryInShop_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormAddPastryInShop));
|
||||
if (service is FormAddPastryInShop form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonSellPastry_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormSellPastry));
|
||||
if (service is FormSellPastry form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
private void ButtonSellPastry_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormSellPastry));
|
||||
if (service is FormSellPastry form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void ClientsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormViewClients));
|
||||
if (service is FormViewClients form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
private void ClientsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormViewClients));
|
||||
if (service is FormViewClients form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void ImplementersToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormViewImplementers));
|
||||
if (service is FormViewImplementers form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
private void ImplementersToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormViewImplementers));
|
||||
if (service is FormViewImplementers form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void DoWorkToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
_workProcess.DoWork((
|
||||
Program.ServiceProvider?.GetService(typeof(IImplementerLogic)) as IImplementerLogic)!,
|
||||
_orderLogic);
|
||||
MessageBox.Show("Ïðîöåññ îáðàáîòêè çàïóùåí", "Ñîîáùåíèå",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
private void DoWorkToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
_workProcess.DoWork((
|
||||
Program.ServiceProvider?.GetService(typeof(IImplementerLogic)) as IImplementerLogic)!,
|
||||
_orderLogic);
|
||||
MessageBox.Show("Ïðîöåññ îáðàáîòêè çàïóùåí", "Ñîîáùåíèå",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user