예제 #1
0
 private GatherSettlementInfo BuildEntity(GatherSettlementInfoVM vm)
 {
     return(EntityConverter <GatherSettlementInfoVM, GatherSettlementInfo> .Convert(vm, (s, t) =>
     {
         t.SourceStockInfo = new BizEntity.Inventory.StockInfo()
         {
             SysNo = Convert.ToInt32(s.StockID),
             StockName = s.StockName
         };
     }));
 }
예제 #2
0
 public override void OnPageLoad(object sender, EventArgs e)
 {
     base.OnPageLoad(sender, e);
     gatherInfoVM  = new GatherSettlementInfoVM();
     filter        = new GatherSettleItemsQueryFilter();
     serviceFacade = new GatherSettlementFacade(this);
     InitComboBoxData();
     this.DataContext = gatherInfoVM;
     SetAccessControl();
     //供应商附加选择事件
     ucVendor.VendorSelected += new EventHandler <VendorSelectedEventArgs>(ucVendor_VendorSelected);
 }
예제 #3
0
 public override void OnPageLoad(object sender, EventArgs e)
 {
     base.OnPageLoad(sender, e);
     serviceFacade = new GatherSettlementFacade(this);
     GetherInfoVM  = new GatherSettlementInfoVM();
     GatherSysNo   = this.Request.Param;
     if (!string.IsNullOrEmpty(GatherSysNo))
     {
         //加载代收结算单信息:
         LoadGatherInfo();
     }
     SetAccessControl();
 }
예제 #4
0
        private void btnDeleteSettledProducts_Click(object sender, RoutedEventArgs e)
        {
            //删除结算商品:
            List <GatherSettlementItemInfoVM> getItemVM = this.SettledProductsGrid.ItemsSource as List <GatherSettlementItemInfoVM>;

            if (null != getItemVM)
            {
                GatherSettlementInfoVM updateVM = new GatherSettlementInfoVM();
                updateVM = EntityConverter <GatherSettlementInfoVM, GatherSettlementInfoVM> .Convert(GetherInfoVM);

                updateVM.GatherSettlementItemInfoList.Clear();
                getItemVM.ForEach(delegate(GatherSettlementItemInfoVM vm)
                {
                    if (vm.IsDeleteChecked)
                    {
                        updateVM.GatherSettlementItemInfoList.Add(vm);
                    }
                });
                if (0 >= updateVM.GatherSettlementItemInfoList.Count)
                {
                    Window.Alert(ResGatherMaintain.AlertMsg_Delete);
                    return;
                }

                Window.Confirm(ResGatherMaintain.AlertMsg_AlertTitle, ResGatherMaintain.AlertMsg_Save, (obj, args) =>
                {
                    if (args.DialogResult == DialogResultType.OK)
                    {
                        serviceFacade.UpdateGatherSettlementInfo(BuildEntity(updateVM), (obj2, args2) =>
                        {
                            if (args2.FaultsHandle())
                            {
                                return;
                            }
                            AlertAndRefreshPage(ResGatherMaintain.AlertMsg_SaveSuc);
                        });
                    }
                });
            }
            else
            {
                Window.Alert(ResGatherMaintain.AlertMsg_Delete);
                return;
            }
        }
예제 #5
0
 private void LoadGatherInfo()
 {
     serviceFacade.LoadGatherSettlementInfo(GatherSysNo, (obj, args) =>
     {
         if (args.FaultsHandle())
         {
             return;
         }
         GetherInfoVM = EntityConverter <GatherSettlementInfo, GatherSettlementInfoVM> .Convert(args.Result, (s, t) =>
         {
             t.StockID   = s.SourceStockInfo.SysNo.ToString();
             t.StockName = s.SourceStockInfo.StockName;
             t.VendorInfo.VendorBasicInfo.PaySettleCompany = s.VendorInfo.VendorBasicInfo.PaySettleCompany;
             txtPaySettleCompany.Text = EnumConverter.GetDescription(t.VendorInfo.VendorBasicInfo.PaySettleCompany);
         });
         this.DataContext = GetherInfoVM;
         SettledProductsGrid.Bind();
         ShowActionButtons(GetherInfoVM.SettleStatus.Value);
     });
 }