Пример #1
0
        private async Task SaveBin(BinViewModel bmv)
        {
            try
            {
                bmv.SaveFields();
                LoadingText = AppResources.RackNewPage_LoadingProgressBin + " " + bmv.Bin.Code;

                int binexist = await NAV.GetBinCount(NewModel.LocationCode, "", "", bmv.Bin.Code, ACD.Default).ConfigureAwait(true);

                if (binexist > 0)
                {
                    LoadingText      = AppResources.RackNewPage_LoadingProgressModifyBin + " " + bmv.Bin.Code;
                    bmv.Bin.PrevCode = bmv.Bin.Code;
                    await NAV.ModifyBin(bmv.Bin, ACD.Default).ConfigureAwait(true);
                }
                else
                {
                    if (CreateNewBins)
                    {
                        LoadingText = AppResources.RackNewPage_LoadingProgressBin + " " + bmv.Bin.Code;
                        await NAV.CreateBin(NewModel.BinsViewModel.BinTemplate.Code, bmv.Bin, ACD.Default).ConfigureAwait(true);
                    }
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Пример #2
0
        private async Task SaveBinChanges(BinViewModel bmv, int index, int count)
        {
            try
            {
                string text1 = String.Format(AppResources.RackEditPage_SaveProcessBinText, No, index, count);
                LoadingText = text1;

                bmv.SaveFields();

                int binexist = await NAV.GetBinCount(LocationCode, "", "", bmv.Bin.Code, ACD.Default).ConfigureAwait(true);

                if (binexist > 0)
                {
                    bmv.Bin.PrevCode = bmv.Bin.Code;
                    await NAV.ModifyBin(bmv.Bin, ACD.Default).ConfigureAwait(true);
                }
                else
                {
                    await NAV.CreateBin(BinTemplateCode, bmv.Bin, ACD.Default).ConfigureAwait(true);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }