beta build

This commit is contained in:
DeerElk 2024-03-13 15:05:59 +04:00
parent 65ea5a95e4
commit 08194a1632
2 changed files with 21 additions and 4 deletions

View File

@ -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 = "Справочники";

View File

@ -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<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()),
};
}
}
}