From 08194a1632e7b71fb8bfc186c4a6ef253fc2e692 Mon Sep 17 00:00:00 2001 From: DeerElk Date: Wed, 13 Mar 2024 15:05:59 +0400 Subject: [PATCH] beta build --- .../Confectionery/FormMain.Designer.cs | 2 +- Confectionery/Confectionery/FormMain.cs | 23 ++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Confectionery/Confectionery/FormMain.Designer.cs b/Confectionery/Confectionery/FormMain.Designer.cs index 86afe81..39f4a1a 100644 --- a/Confectionery/Confectionery/FormMain.Designer.cs +++ b/Confectionery/Confectionery/FormMain.Designer.cs @@ -113,7 +113,7 @@ // // referencesToolStripMenuItem // - referencesToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { pastriesToolStripMenuItem, componentsToolStripMenuItem }); + referencesToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { componentsToolStripMenuItem, pastriesToolStripMenuItem }); referencesToolStripMenuItem.Name = "referencesToolStripMenuItem"; referencesToolStripMenuItem.Size = new Size(139, 29); referencesToolStripMenuItem.Text = "Справочники"; diff --git a/Confectionery/Confectionery/FormMain.cs b/Confectionery/Confectionery/FormMain.cs index bcc89bc..599d3ac 100644 --- a/Confectionery/Confectionery/FormMain.cs +++ b/Confectionery/Confectionery/FormMain.cs @@ -79,7 +79,7 @@ namespace ConfectioneryView try { var operationResult = _orderLogic.TakeOrderInWork( - new OrderBindingModel { Id = id }); + CreateBindingModel(id)); if (!operationResult) { throw new Exception( @@ -107,7 +107,7 @@ namespace ConfectioneryView try { var operationResult = _orderLogic.FinishOrder( - new OrderBindingModel { Id = id }); + CreateBindingModel(id)); if (!operationResult) { throw new Exception("Ошибка при сохранении. " + @@ -134,7 +134,7 @@ namespace ConfectioneryView try { var operationResult = _orderLogic.DeliveryOrder( - new OrderBindingModel { Id = id }); + CreateBindingModel(id)); if (!operationResult) { throw new Exception("Ошибка при сохранении. " + @@ -155,5 +155,22 @@ namespace ConfectioneryView { LoadData(); } + private OrderBindingModel CreateBindingModel(int id, bool isDone = false) + { + return new OrderBindingModel + { + Id = id, + PastryId = Convert.ToInt32(dataGridView.SelectedRows[ + 0].Cells["PastryId"].Value), + Status = Enum.Parse(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()), + }; + } } }