Winform查询数据对话窗体与选择资料窗体实现|C/S框架网
Winform查询数据对话窗体与选择资料窗体实现|C/S框架网
VIP会员下载:QueryDialogSample.rar
CSFramework快速开发框架各个版本提供Winform查询数据对话窗体与选择资料窗体实例,各个版本的实现思路是一致的,基于Winform标准三层逻辑架构实现:FORM->BLL-DAL。
下面是基于CSFramework V5.x旗舰版最新开发的例子。
【物料编码】对应ButtonEdit组件,在ButtonClick事件打开查询窗体:
存货档案(产品资料库)查询窗体:
ButtonClick事件的代码:
C# Code:
DataRow R = frmQueryInventoryBaseData.Execute();
if (R != null)
{
DataRow row = gvDetail.GetFocusedDataRow();
row[tb_PlanMainDtl.InvCode] = R[dt_Inventory.InvCode];
row[tb_PlanMainDtl.InvName] = R[dt_Inventory.InvName];
row[tb_PlanMainDtl.InvStd] = R[dt_Inventory.InvStd];
gvDetail.UpdateCurrentRow();
}
//来源:C/S框架网(www.csframework.com) QQ:23404761
DataRow R = frmQueryInventoryBaseData.Execute();
if (R != null)
{
DataRow row = gvDetail.GetFocusedDataRow();
row[tb_PlanMainDtl.InvCode] = R[dt_Inventory.InvCode];
row[tb_PlanMainDtl.InvName] = R[dt_Inventory.InvName];
row[tb_PlanMainDtl.InvStd] = R[dt_Inventory.InvStd];
gvDetail.UpdateCurrentRow();
}
//来源:C/S框架网(www.csframework.com) QQ:23404761
frmQueryInventoryBaseData选择窗体的打开方式:
C# Code:
public static DataRow Execute()
{
frmQueryInventoryBaseData form = new frmQueryInventoryBaseData();
form.ShowDialog();
return form._ReturnRow;
}
//来源:C/S框架网(www.csframework.com) QQ:23404761
public static DataRow Execute()
{
frmQueryInventoryBaseData form = new frmQueryInventoryBaseData();
form.ShowDialog();
return form._ReturnRow;
}
//来源:C/S框架网(www.csframework.com) QQ:23404761
工种档案查询窗体:
查询窗体的统一外部接口:
C# Code:
public static DataRow Execute()
{
frmQueryWorkTypeBaseData form = new frmQueryWorkTypeBaseData();
form.ShowDialog();
return form._ReturnRow;
}
//来源:C/S框架网(www.csframework.com) QQ:23404761
public static DataRow Execute()
{
frmQueryWorkTypeBaseData form = new frmQueryWorkTypeBaseData();
form.ShowDialog();
return form._ReturnRow;
}
//来源:C/S框架网(www.csframework.com) QQ:23404761
使用方法:
C# Code:
DataRow R = frmQueryWorkTypeBaseData.Execute();
if (R != null)
{
DataRow row = gvDetail2.GetFocusedDataRow();
row[tb_SemiDispProcess.ProcessID] = R[dt_WorkType.TypeID];
row[tb_SemiDispProcess.ProcessName] = R[dt_WorkType.TypeName];
row[tb_SemiDispProcess.WorkTypeID] = R[dt_WorkType.TypeID];
row[tb_SemiDispProcess.WorkTypeName] = R[dt_WorkType.TypeName];
gvDetail2.UpdateCurrentRow();
}
//来源:C/S框架网(www.csframework.com) QQ:23404761
DataRow R = frmQueryWorkTypeBaseData.Execute();
if (R != null)
{
DataRow row = gvDetail2.GetFocusedDataRow();
row[tb_SemiDispProcess.ProcessID] = R[dt_WorkType.TypeID];
row[tb_SemiDispProcess.ProcessName] = R[dt_WorkType.TypeName];
row[tb_SemiDispProcess.WorkTypeID] = R[dt_WorkType.TypeID];
row[tb_SemiDispProcess.WorkTypeName] = R[dt_WorkType.TypeName];
gvDetail2.UpdateCurrentRow();
}
//来源:C/S框架网(www.csframework.com) QQ:23404761
VIP会员下载:QueryDialogSample.rar
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网