Пример #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 LoadAll()
        {
            if (NotNetOrConnection)
            {
                return;
            }

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

                if ((!IsDisposed) && (list is List <Location>))
                {
                    FillModel(list);
                }
            }
            catch (OperationCanceledException e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                ErrorText = e.Message;
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                ErrorText = e.Message;
                State     = ModelState.Error;
                ErrorText = AppResources.Error_LoadLocationList;
            }
        }
Пример #3
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;
            }
        }
Пример #4
0
        private async Task LoadLocationsList()
        {
            List <Location> locations = await NAV.GetLocationList("", false, 1, int.MaxValue, ACD.Default).ConfigureAwait(true);

            if (!IsDisposed)
            {
                Locations.Clear();
                foreach (Location location in locations)
                {
                    Locations.Add(location);
                }
                LocationsIsLoaded = CanChangeLocationAndZone && locations.Count > 0;
            }
        }
Пример #5
0
        private async Task LoadLocationsList()
        {
            List <Location> loadedlocations = await NAV.GetLocationList("", false, 1, int.MaxValue, ACD.Default).ConfigureAwait(true);

            if ((!IsDisposed) && (loadedlocations is List <Location>))
            {
                Locations.Clear();
                foreach (Location location in loadedlocations)
                {
                    Locations.Add(location);
                }
                Location finded = Locations.Find(x => x.Code == LocationCode);
                if (finded is Location)
                {
                    SelectedLocation = finded;
                }
            }
        }
        public async Task Load()
        {
            if (NotNetOrConnection)
            {
                return;
            }

            try
            {
                State     = ModelState.Loading;
                PlanWidth = await NAV.GetPlanWidth(ACD.Default).ConfigureAwait(true);

                PlanHeight = await NAV.GetPlanHeight(ACD.Default).ConfigureAwait(true);

                CheckPlanSizes();
                List <Location> list = await NAV.GetLocationList("", true, 1, int.MaxValue, ACD.Default).ConfigureAwait(true);

                if ((list is List <Location>) && (!IsDisposed))
                {
                    FillModel(list);
                }
            }
            catch (OperationCanceledException e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                ErrorText = e.Message;
            }
            catch (NAVErrorException e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                State     = ModelState.Error;
                ErrorText = AppResources.Error_LoadLocation + Environment.NewLine + e.Message;
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                State     = ModelState.Error;
                ErrorText = AppResources.Error_LoadLocation + Environment.NewLine + e.Message;
            }
        }