Пример #1
0
        public async Task CheckNo()
        {
            NoWarningText = "";
            if ((LocationCode != "") && (ZoneCode != "") && (No != ""))
            {
                int exist = await NAV.GetRackCount(LocationCode, ZoneCode, No, false, ACD.Default).ConfigureAwait(true);

                if (exist > 0)
                {
                    NoWarningText = AppResources.RackNewPage_CodeAlreadyExist;
                }
            }
        }
Пример #2
0
        public async Task CreateRackInNAV()
        {
            if (!CanSave())
            {
                return;
            }

            State         = ModelState.Loading;
            LoadAnimation = true;
            Rack newrack = new Rack();

            SaveFields(newrack);
            try
            {
                LoadingText = AppResources.RackNewPage_LoadingProgressRack + " " + newrack.No;
                int rackexist = await NAV.GetRackCount(LocationCode, ZoneCode, No, false, ACD.Default).ConfigureAwait(true);
                await ModifyRack(newrack, rackexist).ConfigureAwait(true);

                bool errorsexist = false;
                foreach (BinViewModel bvm in BinsViewModel.BinViewModels)
                {
                    try
                    {
                        await SaveBin(bvm).ConfigureAwait(true);
                    }
                    catch (Exception e)
                    {
                        System.Diagnostics.Debug.WriteLine(e.Message);
                        errorsexist = true;
                        ErrorText  += e.Message;
                    }
                }
                SaveFields(Rack);
                LoadAnimation = false;
                if (errorsexist)
                {
                    State = ModelState.Error;
                }
                else
                {
                    MessagingCenter.Send <RackViewModel>(this, "Update");
                    await Navigation.PopAsync();
                }
            }
            catch (Exception e)
            {
                LoadAnimation = false;
                State         = ModelState.Error;
                ErrorText     = e.Message;
            }
        }
Пример #3
0
        public async Task CheckNo()
        {
            InfoText = "";
            if ((NewModel.LocationCode != "") &&
                (NewModel.ZoneCode != "") &&
                (NewModel.No != ""))
            {
                int exist = await NAV.GetRackCount(NewModel.LocationCode, NewModel.ZoneCode, NewModel.No, false, ACD.Default).ConfigureAwait(true);

                if (NotDisposed)
                {
                    if (exist > 0)
                    {
                        InfoText = AppResources.RackNewPage_CodeAlreadyExist;
                    }
                }
            }
        }