예제 #1
0
        public async Task LoadRacks()
        {
            if (IsEditMode)
            {
                return;
            }

            RacksIsLoaded      = false;
            RacksIsBeingLoaded = true;
            try
            {
                List <Rack> racks = await NAV.GetRackList(LocationCode, Code, true, 1, int.MaxValue, ACD.Default).ConfigureAwait(true);

                if (NotDisposed)
                {
                    FillRacks(racks);
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
            }
            finally
            {
                RacksIsBeingLoaded = false;
            }
        }
예제 #2
0
        public async Task LoadRacks()
        {
            if (IsEditMode)
            {
                return;
            }

            RacksIsLoaded      = false;
            RacksIsBeingLoaded = true;
            try
            {
                List <Rack> racks = await NAV.GetRackList(LocationCode, Code, true, 1, int.MaxValue, ACD.Default).ConfigureAwait(true);

                if (!IsDisposed)
                {
                    SubSchemeElements.Clear();
                    foreach (Rack rack in racks)
                    {
                        SubSchemeElement sse = CreateSSE(rack);

                        if (Global.SearchResponses is List <SearchResponse> )
                        {
                            List <SearchResponse> list = Global.SearchResponses.FindAll(x => x.ZoneCode == Code && x.RackNo == rack.No);
                            if (list is List <SearchResponse> )
                            {
                                sse.Selection = new List <SubSchemeSelect>();
                                foreach (SearchResponse sr in list)
                                {
                                    SubSchemeSelect sss = new SubSchemeSelect
                                    {
                                        Section = sr.Section,
                                        Level   = sr.Level,
                                        Depth   = sr.Depth
                                    };
                                    sse.Selection.Add(sss);
                                }
                            }
                        }
                        SubSchemeElements.Add(sse);
                    }
                    RacksIsLoaded = SubSchemeElements.Count > 0;
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
            }
            finally
            {
                RacksIsBeingLoaded = false;
            }
        }
        public async Task LoadAll()
        {
            if (NotNetOrConnection)
            {
                return;
            }

            try
            {
                State = ModelState.Loading;
                List <Rack> racks = await NAV.GetRackList(Zone.LocationCode, Zone.Code, false, 1, int.MaxValue, ACD.Default).ConfigureAwait(true);

                if ((!IsDisposed) && (racks is List <Rack>))
                {
                    FillModel(racks);
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                State     = ModelState.Error;
                ErrorText = AppResources.Error_LoadRacksList;
            }
        }