public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); newVM = new ConsignAdjustVM { SettleRangeDate = DateTime.Today }; serviceFacade = new ConsignAdjustFacade(this); this.DataContext = newVM; this.DeductGrid.Bind(); }
public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); newVM = new ConsignAdjustVM(); serviceFacade = new ConsignAdjustFacade(this); getSysNo = this.Request.Param; if (null != getSysNo) { LoadBasicInfo(); } }
public void LoadBasicInfo() { serviceFacade.LoadInfo(getSysNo, (obj, args) => { if (args.FaultsHandle()) { Window.Alert(args.Error.Faults[0].ErrorDescription); return; } if (null != args.Result) { newVM = EntityConverter <ConsignAdjustInfo, ConsignAdjustVM> .Convert(args.Result); newVM.SettleRangeDate = Convert.ToDateTime(newVM.SettleRange); this.DataContext = newVM; this.DeductGrid.ItemsSource = newVM.ItemList; //已审核过和作废的单据仅能查看,待审核的可编辑 if (this.newVM.Status == ConsignAdjustStatus.WaitAudit) { this.btnSave.IsEnabled = true; this.btnAddDeduct.IsEnabled = true; this.btnDel.IsEnabled = true; this.btnAudit.IsEnabled = true; this.btnAbandon.IsEnabled = true; } else { this.btnSave.IsEnabled = false; this.btnAddDeduct.IsEnabled = false; this.btnDel.IsEnabled = false; this.btnAudit.IsEnabled = false; this.btnAbandon.IsEnabled = false; } } else { Window.Alert("无效的单据号"); return; } }); }