public override void DisposeModel() { BinTypes.Clear(); Locations.Clear(); Zones.Clear(); base.DisposeModel(); }
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; } }
private void AddBinTypes(List <BinType> bintypes) { BinTypes.Clear(); foreach (BinType bt in bintypes) { BinTypes.Add(bt); } BinTypesIsLoaded = bintypes.Count > 0; MessagingCenter.Send <ZoneViewModel>(this, "BinTypesIsLoaded"); }
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; } } }