private void ExecuteCancel() { try { if (Operation is StationActionViewModel) { var cmd = DataListCommand.FirstOrDefault(p => p.Status == EnumCommandWMSStatus.Active); if (cmd != null) { using (WMSToUIClient client = new WMSToUIClient()) { client.CancelCommand(new DTOCommand { ID = cmd.WMSID }); } } } Operation = null; EnabledCC = false; VisibleOperation = false; } catch (Exception e) { _warehouse.AddEvent(Database.Event.EnumSeverity.Error, Database.Event.EnumType.Exception, e.Message); } }
private void ExecuteConfirm() { try { EditEnabled = false; EnabledCC = false; try { switch (_selectedCommand) { case CommandType.Delete: using (WMSToUIClient client = new WMSToUIClient()) { client.CancelCommand(new DTOCommand { ID = Selected.WMSID }); _dbservicewms.AddLog(_accessUser, EnumLogWMS.Event, "UI", $"Delete command: |{Selected.WMSID}|"); } break; default: break; } if (Detailed != null) { Detailed.ValidationEnabled = false; } } catch (Exception e) { _warehouse.AddEvent(Event.EnumSeverity.Error, Event.EnumType.Exception, e.Message); } } catch (Exception e) { _warehouse.AddEvent(Database.Event.EnumSeverity.Error, Database.Event.EnumType.Exception, string.Format("{0}.{1}: {2}", this.GetType().Name, (new StackTrace()).GetFrame(0).GetMethod().Name, e.Message)); } }
private void ExecuteConfirm() { try { EditEnabled = false; EnabledCC = false; try { switch (_selectedCmd) { case CommandType.ReleaseOrder: _dbservicewms.UpdateOrders(DetailedOrder.ERPID, DetailedOrder.OrderID, DetailedOrder.Order); SelectedOrder.Destination = DetailedOrder.Destination; SelectedOrder.ReleaseTime = DetailedOrder.ReleaseTime; _dbservicewms.AddLog(_accessUser, EnumLogWMS.Event, "UI", $"Release order: {DetailedOrder.Order.ToString()}"); break; case CommandType.DeleteOrder: using (WMSToUIClient client = new WMSToUIClient()) { client.CancelOrder(new DTOOrder { ID = 0, ERP_ID = DetailedOrder.ERPID, OrderID = DetailedOrder.OrderID, ReleaseTime = DetailedOrder.ReleaseTime, Destination = DetailedOrder.Destination }); _dbservicewms.AddLog(_accessUser, EnumLogWMS.Event, "UI", $"Cancel order: {DetailedOrder.Order.ToString()}"); } break; case CommandType.DeleteSubOrder: using (WMSToUIClient client = new WMSToUIClient()) { client.CancelOrder(new DTOOrder { ID = SelectedSubOrder.ID, ERP_ID = SelectedSubOrder.ERPIDref, OrderID = SelectedSubOrder.OrderID, ReleaseTime = SelectedSubOrder.ReleaseTime, Destination = SelectedSubOrder.Destination }); _dbservicewms.AddLog(_accessUser, EnumLogWMS.Event, "UI", $"Cancel suborder: {DetailedOrder.Order.ToString()}"); } break; case CommandType.DeleteCommand: using (WMSToUIClient client = new WMSToUIClient()) { client.CancelCommand(new DTOCommand { ID = SelectedCommand.WMSID }); _dbservicewms.AddLog(_accessUser, EnumLogWMS.Event, "UI", $"Delete command: |{SelectedCommand.WMSID}|"); } break; case CommandType.ClearRamp: if (_dbservicewms.ClearRamp(SelectedPlaceID)) { _warehouse.DBService.ClearRamp(SelectedPlaceID); _dbservicewms.AddLog(_accessUser, EnumLogWMS.Event, "UI", $"Clear ramp: |{SelectedPlaceID}|"); } break; case CommandType.ReleaseRamp: using (WMSToUIClient client = new WMSToUIClient()) { // client.ReleaseRamp(SelectedPlaceID); } //_dbservicewms.ReleaseRamp(SelectedPlaceID); _dbservicewms.AddLog(_accessUser, EnumLogWMS.Event, "UI", $"Release ramp: |{SelectedPlaceID}|"); break; } VisibleOrder = true; VisibleRamp = false; _selectedCmd = CommandType.None; } catch (Exception e) { _warehouse.AddEvent(Event.EnumSeverity.Error, Event.EnumType.Exception, e.Message); } } catch (Exception e) { _warehouse.AddEvent(Database.Event.EnumSeverity.Error, Database.Event.EnumType.Exception, string.Format("{0}.{1}: {2}", this.GetType().Name, (new StackTrace()).GetFrame(0).GetMethod().Name, e.Message)); } }