示例#1
0
        public async Task RunBinContentTap(BinContentShortViewModel bcsvm)
        {
            try
            {
                State         = ModelState.Loading;
                LoadAnimation = true;
                NAVFilter navfilter = new NAVFilter
                {
                    LocationCodeFilter = LocationCode,
                    ZoneCodeFilter     = ZoneCode,
                    RackIDFilter       = ID.ToString(),
                    BinCodeFilter      = bcsvm.BinCode,
                    ItemNoFilter       = bcsvm.ItemNo,
                    DescriptionFilter  = bcsvm.Description
                };
                string response = await NAV.RunBCTap(navfilter, ACD.Default).ConfigureAwait(true);

                State = ModelState.Normal;
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                State     = ModelState.Error;
                ErrorText = e.Message;
            }
            finally
            {
                LoadAnimation = false;
            }
        }
示例#2
0
 private void FillBinContent(BinViewModel bvm, List <BinContent> bincontent)
 {
     bvm.BinContent.Clear();
     foreach (BinContent bc in bincontent)
     {
         BinContentShortViewModel bcsvm = new BinContentShortViewModel(Navigation, bc);
         bvm.BinContent.Add(bcsvm);
     }
 }
 private void FillBinContent(BinViewModel bvm, List <BinContent> bincontent)
 {
     if ((!IsDisposed) && (bincontent.Count > 0))
     {
         bvm.BinContent.Clear();
         foreach (BinContent bc in bincontent)
         {
             BinContentShortViewModel bsvm = new BinContentShortViewModel(Navigation, bc);
             bvm.BinContent.Add(bsvm);
         }
     }
 }
示例#4
0
        private async void Bvm_OnTap(BinViewModel bvm)
        {
            bvm.Selected = !bvm.Selected;

            BinViewModel selectedbvm = BinViewModels.Find(x => x.Selected == true);

            IsSelectedBins = selectedbvm is BinViewModel;

            if (selectedbvm is BinViewModel)
            {
                SetTemplateBySelectedBin(selectedbvm);
            }

            if (bvm.IsContent)
            {
                bvm.LoadAnimation = true;
                try
                {
                    List <BinContent> bincontent = await NAV.GetBinContentList(LocationCode, ZoneCode, bvm.Code, "", "", 1, int.MaxValue, ACD.Default).ConfigureAwait(true);

                    if ((!IsDisposed) && (bincontent.Count > 0))
                    {
                        bvm.BinContent.Clear();
                        foreach (BinContent bc in bincontent)
                        {
                            BinContentShortViewModel bsvm = new BinContentShortViewModel(Navigation, bc);
                            bvm.BinContent.Add(bsvm);
                        }
                    }
                }
                catch (OperationCanceledException e)
                {
                    System.Diagnostics.Debug.WriteLine("Cancel LoadBinContent", e.Message);
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.WriteLine(e.Message);
                }
                bvm.LoadAnimation = false;
            }

            List <BinViewModel> list = BinViewModels.FindAll(x => x.Selected == true);

            if (list is List <BinViewModel> )
            {
                ObservableCollection <BinContentShortViewModel> nlist = new ObservableCollection <BinContentShortViewModel>();

                foreach (BinViewModel bvm1 in list)
                {
                    foreach (BinContentShortViewModel bcsvm in bvm1.BinContent)
                    {
                        nlist.Add(bcsvm);
                    }
                }

                SelectedBinContent     = nlist;
                EditedBinCodeIsEnabled = list.Count == 1;
            }
            else
            {
                EditedBinCodeIsEnabled = false;
            }

            if (OnBinClick is Action <BinsViewModel> )
            {
                OnBinClick(this);
            }
        }