CSFrameworkV6旗舰版 - 复制单据功能
C# 全选
public void DoClone(IButtonInfo sender)
{
this.AssertFocusedRow();
var row = gvSummary.GetRow<res_tb_PO>();
if (Msg.AskQuestion($"确定要复制单据【{row.PONO}】吗?"))
{
//重新获取当前单据
this.DoViewContent(this.Buttons.GetButtonByName(ButtonNameList.btnView));
if (this.IsViewMode)
{
//重置主表的数据
_BLL.DataBinder.isid = IdHelper.GetId();
_BLL.DataBinder.PONO = Globals.DEF_NO_TEXT; //新单号
_BLL.DataBinder.DocDate = DateTime.Today;
_BLL.DataBinder.CreatedBy = Core.Loginer.CurrentUser.Account;
_BLL.DataBinder.CreationDate = DateTime.Now;
_BLL.DataBinder.FlagApp = "N";
_BLL.DataBinder.AppDate = null;
_BLL.DataBinder.AppUser = null;
_BLL.DataBinder.FlagPayment = "N";
_BLL.DataBinder.FlagPeriod = "N";
_BLL.DataBinder.FlagStop = "N";
_BLL.DataBinder.FlagFinish = "N";
//重置明细表的数据
foreach (var R in _BLL.CurrentBusiness.Details)
{
R.isid = IdHelper.GetId();
R.PONO = _BLL.DataBinder.PONO; //外键单号
R.CreatedBy = Core.Loginer.CurrentUser.Account;
R.CreationDate = DateTime.Now;
R.FlagPayment = "N";
R.FlagStop = "N";
}
//以下处理界面组件状态
_UpdateType = UpdateType.Add; //重要!
this.SetEditMode();//重要!
this.ButtonStateChanged(UpdateType.Add);//重要!
this.DoBindingSummaryEditor(_BLL.DataBinder);
this.ShowDetailPage(true);
gcDetail.DataSource = _BLL.CurrentBusiness.Details;
gcDetail.RefreshDataSource();
}
}
}版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网





