Exemplo n.º 1
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;
        }