Compare commits
9 Commits
ef3d3d4114
...
461ada29fb
Author | SHA1 | Date | |
---|---|---|---|
461ada29fb | |||
b199a71b8a | |||
a8b8f627b3 | |||
39c6ef7591 | |||
390d10adb9 | |||
f773128233 | |||
53432af1bb | |||
62af0c7ec5 | |||
d4154bcccc |
@ -105,14 +105,8 @@ namespace LawFirmView
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel
|
var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel
|
||||||
{ //id,name,count,sum,status,start,end
|
{
|
||||||
Id = id,
|
Id = id
|
||||||
DocumentId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["DocumentId"].Value),
|
|
||||||
DocumentName = dataGridView.SelectedRows[0].Cells["DocumentName"].Value.ToString(),
|
|
||||||
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)
|
if (!operationResult)
|
||||||
{
|
{
|
||||||
@ -139,13 +133,7 @@ namespace LawFirmView
|
|||||||
{
|
{
|
||||||
var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel
|
var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id
|
||||||
DocumentId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["DocumentId"].Value),
|
|
||||||
DocumentName = dataGridView.SelectedRows[0].Cells["DocumentName"].Value.ToString(),
|
|
||||||
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)
|
if (!operationResult)
|
||||||
{
|
{
|
||||||
@ -171,13 +159,7 @@ namespace LawFirmView
|
|||||||
{
|
{
|
||||||
var operationResult = _orderLogic.FinishOrder(new OrderBindingModel
|
var operationResult = _orderLogic.FinishOrder(new OrderBindingModel
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id
|
||||||
DocumentId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["DocumentId"].Value),
|
|
||||||
DocumentName = dataGridView.SelectedRows[0].Cells["DocumentName"].Value.ToString(),
|
|
||||||
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)
|
if (!operationResult)
|
||||||
{
|
{
|
||||||
|
@ -42,8 +42,31 @@ namespace LawFirmBusinessLogic.BusinessLogics
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool StatusUpdate(OrderBindingModel model, OrderStatus newStatus)
|
public bool StatusUpdate(OrderBindingModel rawModel, OrderStatus newStatus)
|
||||||
{
|
{
|
||||||
|
var viewModel = _orderStorage.GetElement(new OrderSearchModel
|
||||||
|
{
|
||||||
|
Id = rawModel.Id
|
||||||
|
});
|
||||||
|
|
||||||
|
if (viewModel == null)
|
||||||
|
{
|
||||||
|
_logger.LogWarning("Order model not found");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
OrderBindingModel model = new OrderBindingModel
|
||||||
|
{
|
||||||
|
Id = viewModel.Id,
|
||||||
|
DocumentId = viewModel.DocumentId,
|
||||||
|
DocumentName = viewModel.DocumentName,
|
||||||
|
Status = viewModel.Status,
|
||||||
|
DateCreate = viewModel.DateCreate,
|
||||||
|
DateImplement = viewModel.DateImplement,
|
||||||
|
Count = viewModel.Count,
|
||||||
|
Sum = viewModel.Sum
|
||||||
|
};
|
||||||
|
|
||||||
CheckModel(model);
|
CheckModel(model);
|
||||||
if (model.Status + 1 != newStatus)
|
if (model.Status + 1 != newStatus)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user