Beispiel #1
0
 private void FillRacks(List <Rack> racks)
 {
     SubSchemeElements.Clear();
     foreach (Rack rack in racks)
     {
         SubSchemeElement sse = CreateSSE(rack);
         CheckGlobalSearch(rack, sse);
         SubSchemeElements.Add(sse);
     }
     RacksIsLoaded = SubSchemeElements.Count > 0;
 }
Beispiel #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;
            }
        }
Beispiel #3
0
 private void AddSubSchemeElements(List <Zone> zones)
 {
     SubSchemeElements.Clear();
     foreach (Zone zone in zones)
     {
         SubSchemeElement sse = new SubSchemeElement
         {
             Text     = zone.Description,
             Left     = zone.Left,
             Top      = zone.Top,
             Height   = zone.Height,
             Width    = zone.Width,
             HexColor = zone.HexColor
         };
         SubSchemeElements.Add(sse);
     }
     ZonesIsLoaded = SubSchemeElements.Count > 0;
 }
Beispiel #4
0
        public async Task LoadZones()
        {
            if (IsEditMode)
            {
                return;
            }

            ZonesIsLoaded      = false;
            ZonesIsBeingLoaded = true;
            try
            {
                List <Zone> zones = await NAV.GetZoneList(Code, "", true, 1, int.MaxValue, ACD.Default);

                if (!IsDisposed)
                {
                    SubSchemeElements.Clear();
                    foreach (Zone zone in zones)
                    {
                        SubSchemeElement sse = new SubSchemeElement
                        {
                            Left     = zone.Left,
                            Top      = zone.Top,
                            Height   = zone.Height,
                            Width    = zone.Width,
                            HexColor = zone.HexColor
                        };
                        SubSchemeElements.Add(sse);
                    }
                    ZonesIsLoaded = SubSchemeElements.Count > 0;
                }
            }
            catch (OperationCanceledException e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                ErrorText = e.Message;
            }
            finally
            {
                ZonesIsBeingLoaded = false;
            }
        }