1
yhj
2024-07-24 5e5d945e91568b973faa27d8ab0bcef99fc4a6c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#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
{
    /// <summary>
    ///     sys_DocNoRule的资料管理窗体,由代码生成器(Code Generator)自动生成
    /// </summary>
    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; //禁止修改
        }
 
        /// <summary>
        ///     绑定修改页面所有文本输入框的数据源
        /// </summary>
        /// <param name="summary">数据源</param>
        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
    }
}