开发框架旗舰版保存数据并重新刷新CurrentBusiness前端缓存数据


保存主从表数据:
C# Code:
private void btnSaveData_Click(object sender, EventArgs e)
{
DataSet dsTemplate = _BLL.CreateSaveData(_BLL.CurrentBusiness); //创建用于保存的临时数据
SaveResult result = _BLL.Update(dsTemplate);//调用业务逻辑保存数据方法
if (result.Success)
{
_BLLInstance.Reload(result.GUID);//重新加载数据
this.UpdateSummaryCurrentRow(_BLL.DataBindRow, result.GUID);//刷新表格内当前记录的缓存数据.
this.DoBindingSummaryEditor(_BLL.DataBinder); //重新显示数据
this.DoBindingDetailGrid(_BLL.CurrentBusiness);
Msg.ShowInformation(result.ToString());
}
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
{
DataSet dsTemplate = _BLL.CreateSaveData(_BLL.CurrentBusiness); //创建用于保存的临时数据
SaveResult result = _BLL.Update(dsTemplate);//调用业务逻辑保存数据方法
if (result.Success)
{
_BLLInstance.Reload(result.GUID);//重新加载数据
this.UpdateSummaryCurrentRow(_BLL.DataBindRow, result.GUID);//刷新表格内当前记录的缓存数据.
this.DoBindingSummaryEditor(_BLL.DataBinder); //重新显示数据
this.DoBindingDetailGrid(_BLL.CurrentBusiness);
Msg.ShowInformation(result.ToString());
}
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
保存数据后:
1. 必须重新加载数据,然后更新表格内当前记录的缓存数据。
2. 重新绑定文本框架数据源,刷新显示数据。
3. 重新绑定明细表格的数据源。
BLL层添加Reload方法,重新加载Business数据:
C# Code:
public void Reload(string docNo)
{
DataSet ds = GetDataByKey(docNo, false);
_CurrentBusiness.Tables.Clear();
foreach (DataTable dt in ds.Tables)
_CurrentBusiness.Tables.Add(dt.Copy());
_CurrentBusiness.AcceptChanges();
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
{
DataSet ds = GetDataByKey(docNo, false);
_CurrentBusiness.Tables.Clear();
foreach (DataTable dt in ds.Tables)
_CurrentBusiness.Tables.Add(dt.Copy());
_CurrentBusiness.AcceptChanges();
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761

扫一扫加微信


版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网