#region
using System;
using System.Data;
using CSFrameworkV5.Business;
using CSFrameworkV5.Common;
using CSFrameworkV5.Core;
using CSFrameworkV5.Library;
using CSFrameworkV5.Library.CommonClass;
#endregion
namespace CSFrameworkV5.SystemModule
{
///
/// sys_DocNoRule的资料管理窗体,由代码生成器(Code Generator)自动生成
///
public partial class frmsys_DocNoRule : frmBaseDataDictionary
{
private bllsys_DocNoRule _BLLInstance;
public frmsys_DocNoRule()
{
InitializeComponent();
}
private void btnEmpty_Click(object sender, EventArgs e)
{
ClearContainerEditorText(pnlSearch);
}
private void btnQuery_Click(object sender, EventArgs e)
{
//搜索数据
try
{
frmWaitingEx.ShowMe(this);
var dt = _BLLInstance.Query(
ConvertEx.ToString(txt_DocCode.EditValue),
ConvertEx.ToString(txt_RuleFormat.EditValue));
DoBindingSummaryGrid(dt); //绑定主表的Grid
ShowSummaryPage(true); //显示Summary页面.
if (gvSummary.RowCount == 0) Msg.Warning("没有找到数据!");
}
finally
{
frmWaitingEx.HideMe(this);
}
}
protected override void
ButtonStateChanged(UpdateType currentState) //按钮状态改变时触发的事件
{
base.ButtonStateChanged(currentState);
if (currentState == UpdateType.Modify)
//txtRowID.Enabled= false;//修改状态下不允许修改【主键】的数据
txtRowID.Properties.ReadOnly = true; //修改状态下不允许修改【主键】的数据
txtCreationDate.Properties.ReadOnly = true; //禁止修改
txtCreatedBy.Properties.ReadOnly = true; //禁止修改
}
///
/// 绑定修改页面所有文本输入框的数据源
///
/// 数据源
protected override void DoBindingSummaryEditor(DataTable summary)
{
DoBindingEditorPanel(pcDetailEditor, summary);
//在此绑定其它自定义的输入框组件,参考frmCustomer的DoBindingSummaryEditor方法
}
private void frmsys_DocNoRule_Load(object sender, EventArgs e)
{
InitializeForm(); //自定义初始化操作
}
protected override void InitializeForm()
{
_SummaryView =
new DevGridView(
gvSummary); //实例化数据视图,此接口可支持不同的视图,比如表格GridControl,树视图TreeList.
//_ActiveEditor = txtRowID;//进入修改状态,显示第一个焦点的输入框,可以不设置
//_KeyEditor = txtRowID;//主键字段输入框,可以不设置
_DetailGroupControl = pcDetailEditor; //【资料编辑】页面所有输入框的容器
_BLL = new bllsys_DocNoRule(); //实例化基类的业务逻辑层
_BLLInstance = _BLL as bllsys_DocNoRule; //本窗体的业务层对象引用
base.InitializeForm();
//建议删除此代码,手工添加图片进来
//picSearch.Image = Globals.LoadImage("50_Search.ico");//查询面板的图标
//btnQuery.Image = Globals.LoadImage("24_Query.ico");//查询图标
//btnEmpty.Image = Globals.LoadImage("24_Refresh.ico");//清空图标
#region 以下代码全自动生成,请调整排版和顺序
#endregion
}
protected override void ShowSummary()
{
//重写方法,打开窗体时不显示任何数据
}
//检查主表数据完整性
protected override bool ValidatingData()
{
if (ConvertEx.ToString(txtDocCode.EditValue).Trim() == string.Empty)
{
Msg.Warning("DocCode不能为空!");
txtDocCode.Focus();
return false;
}
if (ConvertEx.ToString(txtRuleFormat.EditValue).Trim() ==
string.Empty)
{
Msg.Warning("RuleFormat不能为空!");
txtRuleFormat.Focus();
return false;
}
return true;
}
#region 自动生成的事件或方法的主体部份
#endregion
}
}