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

            List <LocationViewModel> list = LocationViewModels.ToList().FindAll(x => x.Selected == true);

            foreach (LocationViewModel lvm in list)
            {
                try
                {
                    Location location = new Location();
                    lvm.SaveFields(location);
                    await NAV.ModifyLocation(location, ACD.Default).ConfigureAwait(true);
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.WriteLine(e.Message);
                    ErrorText = e.Message;
                }
            }
            UpdateMinSizes();
        }
        public async Task SaveLocationParams()
        {
            if (NotNetOrConnection)
            {
                return;
            }

            Location.PlanWidth  = PlanWidth;
            Location.PlanHeight = PlanHeight;
            await NAV.ModifyLocation(Location, ACD.Default).ConfigureAwait(true);
        }
Example #3
0
        private async Task ModifyLocation(Location location)
        {
            try
            {
                await NAV.ModifyLocation(location, ACD.Default).ConfigureAwait(true);

                await Navigation.PopAsync();
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Example #4
0
        public async void OK()
        {
            State         = ModelState.Loading;
            LoadAnimation = true;
            SaveFields(Location);
            if (CreateMode)
            {
                try
                {
                    await NAV.CreateLocation(Location, ACD.Default);

                    await Navigation.PopAsync();
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.WriteLine(e.Message);
                    State     = ModelState.Error;
                    ErrorText = e.Message + " " + e.StackTrace;
                }
            }
            else
            {
                try
                {
                    await NAV.ModifyLocation(Location, ACD.Default);

                    await Navigation.PopAsync();
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.WriteLine(e.Message);
                    State     = ModelState.Error;
                    ErrorText = e.Message + " " + e.StackTrace;
                }
            }
            LoadAnimation = false;
        }