예제 #1
0
        private void ExecuteConfirm()
        {
            try
            {
                EditEnabled      = false;
                EnabledCC        = false;
                VisibleOperation = false;
                try
                {
                    switch (_selectedCmd)
                    {
                    case CommandType.StoreTray:
                        using (WMSToUIClient client = new WMSToUIClient())
                        {
                            client.StoreTUID((Operation as StationStoreTrayViewModel).TUID);
//                              _dbservicewms.CreateOrder_StoreTUID((Operation as StationStoreTrayViewModel).TUID);
                        }
                        break;

                    case CommandType.BringTray:
                        _dbservicewms.CreateOrder_BringTUID((Operation as StationRemoveTrayViewModel).TUID);
                        break;

                    case CommandType.RemoveTray:
                        _dbservicewms.CreateOrder_RemoveTUID((Operation as StationRemoveTrayViewModel).TUID);
                        break;

                    case CommandType.DropBox:
                        _dbservicewms.CreateOrder_DropBox((Operation as StationDropBoxViewModel).TUID, (Operation as StationDropBoxViewModel).BoxList);
                        break;

                    case CommandType.BringBox:
                        _dbservicewms.CreateOrder_BringBox((Operation as StationPickBoxViewModel).BoxList);
                        break;

                    case CommandType.PickBox:
                        _dbservicewms.CreateOrder_PickBox((Operation as StationPickBoxViewModel).BoxList);
                        break;

                    case CommandType.CancelOrder:
                        using (WMSToUIClient client = new WMSToUIClient())
                        {
                            client.CancelOrder(new DTOOrder
                            {
                                ERP_ID     = SelectedOrder.ERPID,
                                OrderID    = SelectedOrder.OrderID,
                                SubOrderID = 0          // cancel all suborders
                            });
                        }
                        break;
                    }
                    _selectedCmd = CommandType.None;
                }
                catch (Exception e)
                {
                    _warehouse.AddEvent(Event.EnumSeverity.Error, Event.EnumType.Exception, e.Message);
                }
                Operation = null;
            }
            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));
            }
        }