public override async void SaveChangesAsync()
        {
            if (NotNetOrConnection)
            {
                return;
            }

            List <ZoneViewModel> list = ZoneViewModels.ToList().FindAll(x => x.IsSelected == true);

            foreach (ZoneViewModel zvm in list)
            {
                try
                {
                    Zone zone = new Zone();
                    zvm.SaveFields(zone);
                    await NAV.ModifyZone(zone, ACD.Default).ConfigureAwait(true);
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.WriteLine(e.Message);
                    State     = ModelState.Error;
                    ErrorText = e.Message;
                }
            }

            UpdateMinSizes();
        }
Example #2
0
 public async Task SaveZoneParams()
 {
     if (NotNetOrConnection)
     {
         return;
     }
     Zone.PlanWidth  = PlanWidth;
     Zone.PlanHeight = PlanHeight;
     await NAV.ModifyZone(Zone, ACD.Default).ConfigureAwait(true);
 }
Example #3
0
        public async Task OK()
        {
            if (NotNetOrConnection)
            {
                return;
            }

            SaveFields(Zone);

            if (CreateMode)
            {
                try
                {
                    IsBeenSavingToNAV = true;
                    await NAV.CreateZone(Zone, ACD.Default).ConfigureAwait(true);

                    await Navigation.PopAsync();
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.WriteLine(e.Message);
                    State     = ModelState.Error;
                    ErrorText = e.Message;
                }
                finally
                {
                    IsBeenSavingToNAV = false;
                }
            }
            else
            {
                try
                {
                    IsBeenSavingToNAV = true;
                    await NAV.ModifyZone(Zone, ACD.Default).ConfigureAwait(true);

                    await Navigation.PopAsync();
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.WriteLine(e.Message);
                    State     = ModelState.Error;
                    ErrorText = e.Message;
                }
                finally
                {
                    IsBeenSavingToNAV = false;
                }
            }
        }