예제 #1
0
        private async Task ExecuteRefreshSubOrder()
        {
            try
            {
                if (_donotrefreshsuborder)
                {
                    return;
                }
                if (_suborderid == null)
                {
                    _suborderid = SelectedSubOrder?.ID;
                }

                if (DataListOrder.Count == 0)
                {
                    DataListSubOrder.Clear();
                }
                if (SelectedOrder != null)
                {
                    var suborders = await _dbservicewms.GetSubOrders(SelectedOrder.ERPID, SelectedOrder.OrderID);

                    DataListSubOrder.Clear();
                    foreach (var p in suborders)
                    {
                        DataListSubOrder.Add(new ReleaseOrderViewModel
                        {
                            ID            = p.ID,
                            ERPID         = p.ERP_ID,
                            OrderID       = p.OrderID,
                            SubOrderID    = p.SubOrderID,
                            SubOrderERPID = p.SubOrderERPID,
                            SubOrderName  = p.SubOrderName,
                            TUID          = p.TU_ID,
                            BoxID         = p.Box_ID,
                            SKUID         = p.SKU_ID,
                            SKUBatch      = p.SKU_Batch,
                            SKUQty        = p.SKU_Qty,
                            Portion       = "",
                            Operation     = (EnumOrderOperation)p.Operation,
                            Status        = (EnumWMSOrderStatus)p.Status
                        });
                    }
                    foreach (var l in DataListOrder)
                    {
                        l.Initialize(_warehouse);
                    }
//                    if (_suborderid != null)
//                        SelectedSubOrder = DataListSubOrder.FirstOrDefault(p => p.ID == _suborderid);
//                    if(SelectedSubOrder == null)
//                        SelectedSubOrder = DataListSubOrder.FirstOrDefault();
                    _suborderid = 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));
            }
        }
예제 #2
0
        private async Task ExecuteRefreshSubOrder()
        {
            try
            {
                if (_suborderid == null)
                {
                    _suborderid = SelectedSubOrder?.ID;
                }

                DataListSubOrder.Clear();
                if (SelectedOrder != null)
                {
                    var suborders = await _dbservicewms.GetSubOrdersBySKUWithCount(SelectedOrder.ERPID, SelectedOrder.OrderID);

                    DataListSubOrder.Clear();
                    foreach (var p in suborders)
                    {
                        DataListSubOrder.Add(new ReleaseOrderViewModel
                        {
                            ID            = p.WMSID,
                            ERPID         = p.ERPID,
                            OrderID       = p.OrderID,
                            SubOrderID    = p.SubOrderID,
                            SubOrderERPID = p.SubOrderERPID,
                            SubOrderName  = p.SubOrderName,
                            SKUID         = p.SKUID,
                            SKUBatch      = p.SKUBatch,
                            SKUQty        = p.SKUQty,
                            Portion       = $"{p.CountAll-p.CountActive-p.CountFinished}+{p.CountActive}+{p.CountFinished}={p.CountAll}",
                            Status        = (EnumWMSOrderStatus)p.Status
                        });
                    }
                    foreach (var l in DataListOrder)
                    {
                        l.Initialize(_warehouse);
                    }
                    if (_suborderid != null)
                    {
                        SelectedSubOrder = DataListSubOrder.FirstOrDefault(p => p.ID == _suborderid);
                    }
                    if (SelectedSubOrder == null)
                    {
                        SelectedSubOrder = DataListSubOrder.FirstOrDefault();
                    }
                    _suborderid = 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));
            }
        }
예제 #3
0
 private void ExecuteRefreshSubOrder()
 {
     try
     {
         DataListSubOrder.Clear();
         if (SelectedOrder != null)
         {
             foreach (var p in _dbservicewms.GetSubOrdersDistinct(SelectedOrder.ERPID, SelectedOrder.OrderID))
             {
                 DataListSubOrder.Add(new OrderViewModel
                 {
                     ID            = p.ID,
                     ERPID         = p.ERP_ID,
                     ERPIDRef      = null,
                     OrderID       = p.OrderID,
                     Destination   = p.Destination,
                     ReleaseTime   = p.ReleaseTime,
                     SubOrderID    = p.SubOrderID,
                     SubOrderERPID = p.SubOrderERPID,
                     SubOrderName  = p.SubOrderName,
                     SKUID         = p.SKU_ID,
                     SKUBatch      = p.SKU_Batch,
                     SKUQty        = p.SKU_Qty,
                     Status        = (EnumWMSOrderStatus)p.Status
                 });
             }
             foreach (var l in DataListOrder)
             {
                 l.Initialize(_warehouse);
             }
             if (SelectedOrder != null)
             {
                 if (_suborderid != -1)
                 {
                     SelectedSubOrder = DataListSubOrder.FirstOrDefault(p => p.SubOrderID == _suborderid);
                 }
                 if (SelectedSubOrder == null)
                 {
                     SelectedSubOrder = DataListSubOrder.FirstOrDefault();
                 }
             }
             ExecuteRefreshSKU();
         }
     }
     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));
     }
 }