Пример #1
0
        public async Task Load()
        {
            if (NotNetOrConnection)
            {
                return;
            }

            try
            {
                LocationsIsBeingLoaded = true;
                BinTypesIsBeingLoaded  = true;
                List <Location> locations = await NAV.GetLocationList("", false, 1, int.MaxValue, ACD.Default).ConfigureAwait(true);

                List <BinType> bintypes = await NAV.GetBinTypeList(1, int.MaxValue, ACD.Default).ConfigureAwait(true);

                if (NotDisposed)
                {
                    AddLocations(locations);
                    AddBinTypes(bintypes);
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                State     = ModelState.Error;
                ErrorText = e.Message;
            }
            finally
            {
                BinTypesIsBeingLoaded  = false;
                LocationsIsBeingLoaded = false;
            }
        }
Пример #2
0
        public async Task Load()
        {
            if (NotNetOrConnection)
            {
                return;
            }

            try
            {
                LocationsIsBeingLoaded = true;
                List <Location> locations = await NAV.GetLocationList("", false, 1, int.MaxValue, ACD.Default).ConfigureAwait(true);

                Locations.Clear();
                foreach (Location location in locations)
                {
                    Locations.Add(location);
                }

                if (CanChangeLocationCode)
                {
                    LocationsIsLoaded = locations.Count > 0;
                }
                else
                {
                    LocationsIsLoaded = false;
                }
                MessagingCenter.Send <ZoneViewModel>(this, "LocationsIsLoaded");



                BinTypesIsBeingLoaded = true;
                List <BinType> bintypes = await NAV.GetBinTypeList(1, int.MaxValue, ACD.Default).ConfigureAwait(true);

                BinTypes.Clear();
                foreach (BinType bt in bintypes)
                {
                    BinTypes.Add(bt);
                }
                BinTypesIsLoaded = bintypes.Count > 0;
                MessagingCenter.Send <ZoneViewModel>(this, "BinTypesIsLoaded");
            }
            catch (OperationCanceledException e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                State     = ModelState.Error;
                ErrorText = e.Message;
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                State     = ModelState.Error;
                ErrorText = e.Message;
            }
            finally
            {
                BinTypesIsBeingLoaded  = false;
                LocationsIsBeingLoaded = false;
            }
        }
Пример #3
0
        private async Task LoadBinTypesList()
        {
            List <BinType> bintypes = await NAV.GetBinTypeList(1, int.MaxValue, ACD.Default).ConfigureAwait(true);

            if (NotDisposed)
            {
                NewModel.BinsViewModel.BinTypes.Clear();
                foreach (BinType bt in bintypes)
                {
                    NewModel.BinsViewModel.BinTypes.Add(bt.Code);
                }
                NewModel.BinsViewModel.BinTypesIsEnabled = bintypes.Count > 0;
            }
        }
Пример #4
0
        private async Task LoadBinTypesList()
        {
            List <BinType> bintypes = await NAV.GetBinTypeList(1, int.MaxValue, ACD.Default).ConfigureAwait(true);

            if (!IsDisposed)
            {
                //ObservableCollection<string> bts = new ObservableCollection<string>();
                NewModel.BinsViewModel.BinTypes.Clear();
                foreach (BinType bt in bintypes)
                {
                    NewModel.BinsViewModel.BinTypes.Add(bt.Code);
                }
                NewModel.BinsViewModel.BinTypesIsEnabled = bintypes.Count > 0;
            }
        }
Пример #5
0
        private async Task LoadBinTypesList()
        {
            List <BinType> loadedbintypes = await NAV.GetBinTypeList(1, int.MaxValue, ACD.Default).ConfigureAwait(true);

            if ((!IsDisposed) && (loadedbintypes is List <BinType>))
            {
                BinTypes.Clear();
                foreach (BinType bintype in loadedbintypes)
                {
                    BinTypes.Add(bintype);
                }
                BinType finded = BinTypes.Find(x => x.Code == BinTypeCode);
                if (finded is BinType)
                {
                    SelectedBinType = finded;
                }
            }
        }