Esempio n. 1
0
        public ImportStockLotViewModel()
        {
            _rule = new StockLotRule();
            _formworkRule = new FormworkRule();
            _rule.AddStockLotAndDetailsCompleted += (s, e) =>
                {
                    if (e.Cancelled)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                    }
                    else
                    {
                        Common.MessageBox.Show("新建LotNo成功!");
                        GuanKongMulti = false;
                        GuanKongSingle = false;
                    }
                };
            _formworkRule.GetFormworkListCompleted += (s, e) =>
            {
                if (e.Cancelled)
                {
                    Common.MessageBox.Show(e.Error.Message);
                }
                else
                {
                    FormWorkCollection = new ObservableCollection<string>(e.Results.Select(p => p.ProductModel));
                }
            };
            _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
            _eventAggregator.GetEvent<CmdEvent>().Subscribe(param =>
            {

            }, ThreadOption.UIThread, true, p => p.Target == "ImportStockLotViewModel");
        }
Esempio n. 2
0
        public Process_DuMoViewModel()
        {
            _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();

            //订阅
            _eventAggregator.GetEvent<CmdEvent>().Subscribe(param =>
            {
                ReadComTest();
            }, ThreadOption.UIThread, true, p => p.Target == "Process_DuMoViewModel");
            _stockLotRule = new StockLotRule();
            _stockLotRule.GetStockLotEntityByLotNoCompleted += (s, e) =>
                {
                    if (e.Cancelled || e.Results == null)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                    }
                    else
                    {
                        CurrentStockLot = e.Results as StockLot;

                    }
                };
            _stockLotRule.UpdateStockDetailStatusCompleted += (s, e) =>
                {
                    if (e.Cancelled)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                    }
                    else
                    {
                        _stockLotRule.GetStockLotEntityByLotNoAsyns(CurrentStockLot.LotNo, 4, IsCheckAll);
                        GlassID = string.Empty;
                    }
                };
            ScanComExecute = (s, e) =>
            {
                GlassID = s.ToString();
                _stockLotRule.UpdateStockDetailStatusAsyns(GlassID, CurrentStockLot.ID, 4);//todo是否验证写死了
                //   AddStockDetailAsyns();
            };
        }
Esempio n. 3
0
        public StockLotDetailViewModel()
        {
            _quInforule = new QualityInfoRule();
            _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
            _rule = new StockLotRule();
            _roleRule = new RoleRule();
            _rule.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName.Equals("IsBusy"))
                {
                    IsBusy = _rule.IsBusy;
                }
            };
            //订阅
            _eventAggregator.GetEvent<CmdEvent>().Subscribe(param =>
            {

                GlassSearchId = string.Empty;
                string LotNo = param.Entity as string;
                _rule.GetStockLotEntityByLotNoAsyns(LotNo, 99, true);
                Account loginAcount = Common.ServiceDataLocator.GetInstance<Account>();
                if (!loginAcount.LoginNumber.Equals("admin"))
                {
                    ExportVisibility = Visibility.Collapsed;
                    HOLDVisibility = Visibility.Collapsed;
                    UnHOLDVisibility = Visibility.Collapsed;

                    string roleDetail = loginAcount.Role.RoleDetail;
                    if (roleDetail.Contains(_roleRule.str查询GlassID + _roleRule.str导出))
                        ExportVisibility = Visibility.Visible;
                    if (roleDetail.Contains(_roleRule.str查询GlassID + _roleRule.strHOLD))
                        HOLDVisibility = Visibility.Visible;
                    if (roleDetail.Contains(_roleRule.str查询GlassID + _roleRule.str接触HOLD))
                        UnHOLDVisibility = Visibility.Visible;
                }
                else
                {
                    ExportVisibility = Visibility.Visible;
                    HOLDVisibility = Visibility.Visible;
                    UnHOLDVisibility = Visibility.Visible;
                }

                //Account loginAcount = Common.ServiceDataLocator.GetInstance<Account>();
                //if (!loginAcount.LoginNumber.Equals("admin"))
                //{
                //    HOLDVisibility = Visibility.Collapsed;
                //    EndStockLotVisibility = Visibility.Collapsed;
                //    string roleDetail = loginAcount.Role.RoleDetail;
                //    if (roleDetail.Contains(_rule.str扫描入库 + _rule.str接触HOLD))
                //        HOLDVisibility = Visibility.Visible;
                //    if (roleDetail.Contains(_rule.str扫描入库 + _rule.str入库结束))
                //        EndStockLotVisibility = Visibility.Visible;
                //}
                //else
                //{
                //    HOLDVisibility = Visibility.Visible;
                //    EndStockLotVisibility = Visibility.Visible;
                //}

                string ErrMsg = string.Empty;
                List<QualityInfo> lst = _quInforule.GetQualityInfoList(new Dictionary<string, string>(), ref ErrMsg);
                if (lst != null)
                {
                    StockInList = new ObservableCollection<string>(lst.Where(p => p.InfoType == "入库").Select(p => p.Name));
                    StockInList.Insert(0, "全部");
                    JianBaoList = new ObservableCollection<string>(lst.Where(p => p.InfoType == "减薄").Select(p => p.Name));
                    JianBaoList.Insert(0, "全部");
                    PaoGuangList = new ObservableCollection<string>(lst.Where(p => p.InfoType == "抛光").Select(p => p.Name));
                    PaoGuangList.Insert(0, "全部");
                    DuMoList = new ObservableCollection<string>(lst.Where(p => p.InfoType == "镀膜").Select(p => p.Name));
                    DuMoList.Insert(0, "全部");

                    StockInSelect = "全部";
                    JianBaoSelect = "全部";
                    PaoGuangSelect = "全部";
                    DuMoSelect = "全部";
                }

            }, ThreadOption.UIThread, true, p => p.Target == "StockLotDetailViewModel");

            _rule.GetStockLotEntityByLotNoCompleted += (s, e) =>
            {
                if (e.Cancelled)
                {
                    Common.MessageBox.Show(e.Error.Message);
                }
                else
                {
                    _lineNumber = 1;
                    CurrentStockLot = e.Results;
                    //LineNumber = 1;

                    StockDetailCollection = new ObservableCollection<StockDetail>(CurrentStockLot.StockDetails);

                    if (CurrentStockLot.StockDetails != null)
                    {
                        double operaterCount = CurrentStockLot.StockDetails.Where(p => p.Status > 0).Count();
                        double holdCount = CurrentStockLot.StockDetails.Where(p => p.IsHOLD).Count();
                        LotNoInfo = string.Format("当前LotNO:{0}    总GlassID数:{1} ,实际操作数:{2} ,其中HOLD数:{3} 。另:退货数为:{4}", CurrentStockLot.LotNo, CurrentStockLot.PCSQty, operaterCount, holdCount, CurrentStockLot.TuiHuoCount);
                        double stockinCount = CurrentStockLot.StockDetails.Where(p => p.StockInDT != null).Count();
                        StockInInfo = string.Format("已完成入库检验的GlassID:{0},所占比例:{1}%", stockinCount, (stockinCount / operaterCount) * 100);
                        double jianbaoCount = CurrentStockLot.StockDetails.Where(p => p.JianBaoDT != null).Count();
                        JianBaoInfo = string.Format("已完成减薄后检验的GlassID:{0},所占比例:{1}%", jianbaoCount, (jianbaoCount / operaterCount) * 100);
                        double paoguangCount = CurrentStockLot.StockDetails.Where(p => p.PaoGuangDT != null).Count();
                        PaoGuangInfo = string.Format("已完成抛光后检验的GlassID:{0},所占比例:{1}%", paoguangCount, (paoguangCount / operaterCount) * 100);
                        double dumoCount = CurrentStockLot.StockDetails.Where(p => p.DuMoDT != null).Count();
                        DuMoInfo = string.Format("已完成镀膜后检验的GlassID:{0},所占比例:{1}%", dumoCount, (dumoCount / operaterCount) * 100);

                    }

                }
            };
            //修改HOLD成功后回调事件
            _rule.ChangeStockDetail_HOLDCompleted += (s, e) =>
                {
                    bool bHOLD = (bool)e.UserState;
                    if (e.Cancelled)
                    {
                        CurrentDetail.IsHOLD = !bHOLD;
                        Common.MessageBox.Show(e.Error.Message);
                    }
                    else
                    {
                        if (bHOLD)
                        {
                            Common.MessageBox.Show(CurrentDetail.GlassID + " 设置HOLD状态成功");
                        }
                        else
                        {
                            Common.MessageBox.Show(CurrentDetail.GlassID + " 取消HOLD状态成功");
                        }
                   //     CurrentDetail.IsHOLD = (bool)e.UserState;
                    }
                };
        }
Esempio n. 4
0
        public StockInMainViewModel()
        {
            _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
            _rule = new RoleRule();
            //订阅
            _eventAggregator.GetEvent<CmdEvent>().Subscribe(param =>
            {
                switch (param.cmdName)
                {
                    case CmdName.New:
                        IsCheck = (bool)param.Entity;
                        _stockLotRule.QtyCount = 0;
                        CurrentStockLot = new StockLot();
                        LotNoEnabled = true;

                        StockInHOLD = false;
                        DuMoHOLD = false;
                        PaoGuangHOLD = false;
                        JianBaoHOLD = false;

                        DuMoImgHOLD = false;
                        PaoGuangImgHOLD = false;
                        JianBaoImgHOLD = false;

                        SumQty = 0;// CurrentStockLot.StockDetails.Count();
                        SurQty = 0;
                        TXTLOTNOISEnabled = true;
                        HOLDQty = "    HOLD数:0 PCS    ";
                        ReadComTest();
                        Account loginAcount = Common.ServiceDataLocator.GetInstance<Account>();
                        if (!loginAcount.LoginNumber.Equals("admin"))
                        {
                            HOLDVisibility = Visibility.Collapsed;
                            EndStockLotVisibility = Visibility.Collapsed;
                            string roleDetail = loginAcount.Role.RoleDetail;
                            if (roleDetail.Contains(_rule.str扫描入库 + _rule.str接触HOLD))
                                HOLDVisibility = Visibility.Visible;
                            if (roleDetail.Contains(_rule.str扫描入库 + _rule.str入库结束))
                                EndStockLotVisibility = Visibility.Visible;
                        }
                        else
                        {
                            HOLDVisibility = Visibility.Visible;
                            EndStockLotVisibility = Visibility.Visible;
                        }
                        if (!string.IsNullOrWhiteSpace(param.Tag))
                        {
                            CurrentStockLot.LotNo = param.Tag;
                            _stockLotRule.GetStockLotEntityByLotNo_ExAsyns(CurrentStockLot.LotNo, 1, IsCheckAll);
                        }
                        break;
                    case CmdName.SaveGlassID:
                        StockDetail entity = param.Entity as StockDetail;
                        AddStockDetailAsyns(entity);
                        break;
                    default:
                        break;
                }

            }, ThreadOption.UIThread, true, p => p.Target == "StockInMainViewModel");

            _formworkRule = new FormworkRule();
            _formworkRule.GetFormworkListCompleted += (s, e) =>
                {
                    if (e.Cancelled)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                    }
                    else
                    {
                        FormWorkCollection = new ObservableCollection<string>(e.Results.Select(p => p.ProductModel));
                    }
                };
            _stockLotRule = new StockLotRule();
            _stockLotRule.GetStockLotEntityByLotNo_ExCompleted += (s, e) =>
            {
                if (e.Cancelled)
                {
                    Common.MessageBox.Show(e.Error.Message);
                }
                else
                {
                    TXTLOTNOISEnabled = false;
                    LineNumber = 1;
                    CurrentStockLot = e.Results as StockLot;
                    ControlsEnabled = (CurrentStockLot == null);
                    LotNoEnabled = ControlsEnabled;
                    if (!ControlsEnabled)
                    {
                        HOLDQty = "    HOLD数:" + _stockLotRule.HOLDQty_Ex + " PCS    ";
                        if (CurrentStockLot.StockDetails != null)//如果它的Glass明细不为空
                        {
                          //  if (_stockLotRule.QtyCount <= 0)  2014年5月6日 12:56:26  无意义
                          //  {
                                SumQty = _stockLotRule.IStockInQty;// CurrentStockLot.StockDetails.Count();
                                SurQty = CurrentStockLot.PCSQty - SumQty;
                           // }
                            CurrentStockLot.StockDetails = CurrentStockLot.StockDetails.OrderByDescending(p => p.StockInDT).ToArray();
                        }
                        if (CurrentStockLot.DetailInfoHOLD != null)
                        {
                            StockInHOLD = CurrentStockLot.DetailInfoHOLD.Contains("入库");
                            DuMoHOLD = CurrentStockLot.DetailInfoHOLD.Contains("镀膜");
                            PaoGuangHOLD = CurrentStockLot.DetailInfoHOLD.Contains("抛光");
                            JianBaoHOLD = CurrentStockLot.DetailInfoHOLD.Contains("减薄");
                        }
                        if (CurrentStockLot.ImageHOLD != null)
                        {
                            DuMoImgHOLD = CurrentStockLot.ImageHOLD.Contains("镀膜");
                            PaoGuangImgHOLD = CurrentStockLot.ImageHOLD.Contains("抛光");
                            JianBaoImgHOLD = CurrentStockLot.ImageHOLD.Contains("减薄");
                        }
                        CurrentFormwork = CurrentStockLot.ProModel;
                        if (CurrentStockLot.Status > 0 && CurrentStockLot.Status < 8)
                        {
                            Common.MessageBox.Show("该LotNo已结束");
                            return;
                        }

                        _eventAggregator.GetEvent<CmdEvent>().Publish(new CmdEventParam()
                        {
                            cmdName = CmdName.Enter,
                            Target = "StockInMainView",
                        });
                    }
                    else
                    {
                        // _formworkRule.GetFormWorkListAsyns();
                    }
                }
            };

            _stockLotRule.AddStockDetailCompleted += (s, e) =>
                {
                    if (e.Cancelled)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                        GlassID = string.Empty;
                    }
                    else
                    {
                        GlassID = string.Empty;
                        SumQty = _stockLotRule.QtyCount;
                        SurQty = CurrentStockLot.PCSQty - SumQty;

                        _stockLotRule.GetStockLotEntityByLotNo_ExAsyns(CurrentStockLot.LotNo, 1, IsCheckAll);
                    }
                    isDispose = false;
                };
            _stockLotRule.GetStockDetailListCompleted += (s, e) =>
                {
                    if (e.Cancelled)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                    }
                    else
                    {
                        //ObservableCollection<StockDetail> tmppdetails = new ObservableCollection<StockDetail>(e.Results);
                        CurrentStockLot.StockDetails = e.Results.OrderByDescending(p => p.CreateDt).ToArray();
                        LineNumber = 1;
                    }
                };
            _stockLotRule.AddStockLotCompleted += (s, e) =>
                {
                    if (e.Cancelled)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                    }
                    else
                    {
                        CurrentStockLot.ID = _stockLotRule.StockID;
                        SumQty = 0;
                        SurQty = CurrentStockLot.PCSQty - SumQty;
                        ControlsEnabled = false;
                    }
                };
            _stockLotRule.ModifyStockDetailListCompleted += (s, e) =>
                {
                    if (e.Cancelled)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                    }
                    else
                        _stockLotRule.GetStockLotEntityByLotNo_ExAsyns(CurrentStockLot.LotNo, 1, IsCheckAll);
                };
            ScanComExecute = (s, e) =>
               {
                   string ErrMsg = string.Empty;
                   if (!_stockLotRule.CheckStockDetail_In(s.ToString(), CurrentStockLot.ID, IsCheck, ref ErrMsg))
                   {
                       //if (ErrMsg.Equals("特殊处理:退货"))
                       //{
                       //    if (!(Common.MessageBox.Show("该ID曾经退货,确定再次入库吗?", Common.LED_MessageBoxButton.YesNo) == Common.LED_MessageBoxResult.Yes))
                       //    {
                       //        isDispose = false;
                       //        return;
                       //    }
                       //}
                       //else
                       //{

                       Common.MessageBox.Show(ErrMsg);
                       isDispose = false;
                       return;
                       //  }
                   }
                   GlassID = s.ToString();
                   //   AddStockDetailAsyns();
                   _eventAggregator.GetEvent<CmdEvent>().Publish(new CmdEventParam()
                   {
                       cmdViewName = CmdViewName.ToolScanGlassID_StockInView,
                       cmdName = CmdName.New,
                       Entity = CurrentStockLot,
                       Target = "Sell",
                   });
               };
        }
Esempio n. 5
0
        public StockLotMainViewModel()
        {
            _roleRule = new RoleRule();

            _rule = new StockLotRule();
            _rule.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName.Equals("IsBusy"))
                {
                    IsBusy = _rule.IsBusy;
                }
            };
            _rule.GetStockLotList_TwoCompleted += (s, e) =>
                {
                    if (e.Cancelled)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                        StockLotCollection = null;
                    }
                    else
                    {
                        _lineNumber = 1;
                        StockLotCollection = new ObservableCollection<StockLot>(e.Results);
                    }
                };
            _rule.DeleteStockLotCompleted += (s, e) =>
                {
                    if (e.Cancelled)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                    }
                    else
                    {
                        Common.MessageBox.Show("删除成功");
                        Dictionary<string, string> queryList = new Dictionary<string, string>();
                        if (EndDt < StartDt)
                        {
                            Common.MessageBox.Show("开始时间不能大于结束时间");
                            return;
                        }
                        queryList.Add("StartDt", StartDt.ToString());
                        queryList.Add("EndDt", EndDt.AddDays(1).ToString());
                        _rule.GetStockLotList_TwoAsyns(queryList);
                    }
                };
            _rule.HOLDAllToNewStockLotCompleted += (s, e) =>
                {
                    if (e.Cancelled)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                    }
                    else
                    {
                        Common.MessageBox.Show("转移成功");
                        Dictionary<string, string> queryList = new Dictionary<string, string>();

                        queryList.Add("StartDt", StartDt.ToString());
                        queryList.Add("EndDt", EndDt.AddDays(1).ToString());
                        _rule.GetStockLotList_TwoAsyns(queryList);
                    }
                };
            //订阅
            _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();

            _eventAggregator.GetEvent<CmdEvent>().Subscribe(param =>
            {
                switch (param.cmdName)
                {
                    case CmdName.New:
                        GlassSearchId = string.Empty;
                        EndDt = DateTime.Now;
                        StartDt = EndDt.AddMonths(-1);

                        break;
                }

            }, ThreadOption.UIThread, true, p => p.Target == "StockLotMainViewModel");
        }
Esempio n. 6
0
        public Process_JianBaoViewModel()
        {
            _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();

            //订阅
            _eventAggregator.GetEvent<CmdEvent>().Subscribe(param =>
            {
                switch (param.cmdName)
                {
                    case CmdName.New:
                        CurrentStockLot = new StockLot();
                        TXTLOTNOISEnabled = true;
                        ReadComTest();
                        CountInfo = string.Empty;//统计初始化

                        Account loginAcount = Common.ServiceDataLocator.GetInstance<Account>();
                        if (!loginAcount.LoginNumber.Equals("admin"))
                        {
                            HOLDVisibility = Visibility.Collapsed;

                            string roleDetail = loginAcount.Role.RoleDetail;
                            if (roleDetail.Contains(_roleRule.str减薄后检验 + _roleRule.str接触HOLD))
                                HOLDVisibility = Visibility.Visible;

                        }
                        else
                        {
                            HOLDVisibility = Visibility.Visible;

                        }

                        if (!string.IsNullOrWhiteSpace(param.Tag))
                        {
                            CurrentStockLot.LotNo = param.Tag;
                            _stockLotRule.GetStockLotEntityByLotNoAsyns(CurrentStockLot.LotNo, STATIC_STATUS, IsCheckAll);
                        }
                        break;

                    case CmdName.SaveGlassID:
                        SaveEntity = param.Entity as StockDetail;
                        SaveEntity.Status = STATIC_STATUS;
                        _stockLotRule.ModifyStockDetailListAsyns(SaveEntity);
                        //  _stockLotRule.UpdateStockDetailStatusAsyns(GlassID, CurrentStockLot.ID, 2);
                        break;

                    default:
                        break;
                }

            }, ThreadOption.UIThread, true, p => p.Target == "Process_JianBaoViewModel");
            _roleRule = new RoleRule();
            _stockLotRule = new StockLotRule();
            _stockLotRule.GetStockLotEntityByLotNoCompleted += (s, e) =>
                {
                    if (e.Cancelled || e.Results == null)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                    }
                    else
                    {
                        TXTLOTNOISEnabled = false;
                        _lineNumber = 1;
                        CurrentStockLot = e.Results as StockLot;
                        CurrentStockLot.StockDetails = CurrentStockLot.StockDetails.OrderByDescending(p => p.JianBaoDT).ToArray();
                        CountInfo = string.Format("            入库数:{0} PCS      HOLD数:{2}     当前已减薄数:{1} PCS", _stockLotRule.StockInQty, _stockLotRule.OperaterQty, _stockLotRule.HOLDQty);

                        _eventAggregator.GetEvent<CmdEvent>().Publish(new CmdEventParam()
                        {
                            cmdName = CmdName.Enter,
                            Target = "Process_JianBaoView",
                        });
                    }
                };
            _stockLotRule.ModifyStockDetailListCompleted += (s, e) =>
                {
                    if (e.Cancelled)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                    }
                    else
                    {

                        List<StockDetail> sd = CurrentStockLot.StockDetails.ToList();
                        SaveEntity.StockLot = CurrentStockLot;
                        sd.Add(SaveEntity);

                        CurrentStockLot.StockDetails = sd.OrderByDescending(p => p.StockInDT).ToArray();

                        int StockInQty = 0;
                        int OperaterQty = 0;
                        int FanGongQty = 0;
                        int HOLDQty = 0;
                        string ErrMsg = string.Empty;
                        if (_stockLotRule.GetStockLotEntityByLotNoTotal(CurrentStockLot.LotNo, STATIC_STATUS, IsCheckAll, ref StockInQty, ref OperaterQty, ref FanGongQty, ref HOLDQty, ref ErrMsg))
                            CountInfo = string.Format("            入库数:{0} PCS      HOLD数:{2}     当前已减薄数:{1} PCS", StockInQty, OperaterQty, HOLDQty);
                        //_stockLotRule.GetStockLotEntityByLotNoAsyns(CurrentStockLot.LotNo, STATIC_STATUS, IsCheckAll);
                        GlassID = string.Empty;
                    }
                    isDispose = false;
                };
            //验证GlassID方法调用成功后
            _stockLotRule.CheckStockDetailStatusCompleted += (s, e) =>
                {
                    if (e.Cancelled)
                    {
                        Common.MessageBox.Show(e.Error.Message);
                        GlassID = string.Empty;
                        isDispose = false;
                    }
                    else
                    {
                        StockDetail entity = e.Results as StockDetail;
                        _eventAggregator.GetEvent<CmdEvent>().Publish(new CmdEventParam()
                        {
                            cmdViewName = CmdViewName.ToolScanGlassID_JianBaoView,
                            Entity = entity,
                            Tag = CurrentStockLot.ImageHOLD,
                            cmdName = CmdName.New,
                            Target = "Sell",
                        });
                    }
                };
            //修改HOLD成功后回调事件
            _stockLotRule.ChangeStockDetail_HOLDCompleted += (s, e) =>
            {
                bool bHOLD = (bool)e.UserState;
                if (e.Cancelled)
                {
                    CurrentDetail.IsHOLD = !bHOLD;
                    Common.MessageBox.Show(e.Error.Message);
                }
                else
                {
                    if (bHOLD)
                    {
                        Common.MessageBox.Show(CurrentDetail.GlassID + " 设置HOLD状态成功");
                    }
                    else
                    {
                        Common.MessageBox.Show(CurrentDetail.GlassID + " 取消HOLD状态成功");
                    }
                }
            };

            ScanComExecute = (s, e) =>
            {
                GlassID = s.ToString();
                _stockLotRule.CheckStockDetailStatusAsyns(GlassID, CurrentStockLot.ID, STATIC_STATUS);
                //    _stockLotRule.UpdateStockDetailStatusAsyns(GlassID, CurrentStockLot.ID, 2);//todo是否验证写死了
                //   AddStockDetailAsyns();
            };
        }
Esempio n. 7
0
        public StockOutMainView()
        {
            InitializeComponent();
            _rule = new StockLotRule();
            _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
            this.DataContext = new ViewModels.StockOutMainViewModel();
            _eventAggregator.GetEvent<CmdEvent>().Subscribe(param =>
            {
                switch (param.cmdName)
                {
                    case CmdName.Refresh:
                        spMain.Children.Clear();
                        StackPanel spHand = new StackPanel();

                        Label lbHand1 = new Label();
                        lbHand1.Content = "LONO:";
                        Label lbHand2 = new Label();
                        lbHand2.Content = "实际入库数:";
                        Label lbHand3 = new Label();
                        lbHand3.Content = "实际出库数:";
                        spHand.Children.Add(lbHand1);
                        spHand.Children.Add(lbHand2);
                        spHand.Children.Add(lbHand3);

                        spMain.Children.Add(spHand);

                        List<int> lst = param.Entity as List<int>;

                        if (lst != null && lst.Count() > 0)
                        {
                            StockOutQtyHelper[] arr = _rule.GetStockOutQtys(lst.ToArray());

                            foreach (StockOutQtyHelper item in arr)
                            {

                                StackPanel sp = new StackPanel();

                                Label lb1 = new Label();
                                lb1.Content = item.LOTNO;
                                Label lb2 = new Label();
                                lb2.Content = item.Qty;
                                Label lb3 = new Label();
                                lb3.Content = item.StockOutQty;
                                sp.Children.Add(lb1);
                                sp.Children.Add(lb2);
                                sp.Children.Add(lb3);

                                spMain.Children.Add(sp);
                                //Label lb = new Label();
                                //lb.Content = item;
                                //lb.Margin = new Thickness(10, 0, 0, 0);
                                //spMain.Children.Add(lb);
                            }
                        }
                        //if (lst != null)
                        //{

                        //}
                        break;
                    case CmdName.New:
                        txtLOTNO.Focus();
                        break;
                    case CmdName.Enter:
                        txtGlassID.Focus();
                        break;
                    default:
                        break;
                }

            }, ThreadOption.UIThread, true, p => p.Target == "StockOutMainView");
        }