Example #1
0
        public async Task CreateRackInNAV()
        {
            State         = ModelState.Loading;
            LoadAnimation = true;
            Rack newrack = new Rack();

            NewModel.SaveFields(newrack);
            try
            {
                LoadingText = AppResources.RackNewPage_LoadingProgressRack + " " + newrack.No;
                int rackid = await NAV.CreateRack(newrack, ACD.Default).ConfigureAwait(true);

                NewModel.ID = rackid;
                foreach (BinViewModel bvm in NewModel.BinsViewModel.BinViewModels)
                {
                    await SaveBin(bvm).ConfigureAwait(true);
                }
                LoadAnimation = false;
                State         = ModelState.Normal;
                await Navigation.PopAsync();
            }
            catch (Exception e)
            {
                LoadAnimation = false;
                State         = ModelState.Error;
                ErrorText     = e.Message;
            }
        }
Example #2
0
 private async Task ModifyRack(Rack newrack, int rackexist)
 {
     if (rackexist > 0)
     {
         if (ConflictRackChange)
         {
             newrack.PrevNo = newrack.No;
             await NAV.ModifyRack(newrack, ACD.Default).ConfigureAwait(true);
         }
         else
         {
             State     = ModelState.Error;
             ErrorText = AppResources.RackNewPage_Error_RackAlreadyExist;
         }
     }
     else
     {
         await NAV.CreateRack(newrack, ACD.Default).ConfigureAwait(true);
     }
 }