啊鑫
2024-07-09 0552fcc8cb73fc3021e2915129f55a42ed3f20e5
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
#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
{
    public partial class frmModuleMgr : frmBaseDataDictionary
    {
        public frmModuleMgr()
        {
            InitializeComponent();
        }
 
        protected override void ButtonStateChanged(UpdateType currentState)
        {
            base.ButtonStateChanged(currentState);
            txtModuleID.Enabled = UpdateType.Add == currentState;
        }
 
        /// <summary>
        ///     绑定输入框
        /// </summary>
        /// <param name="summary"></param>
        protected override void DoBindingSummaryEditor(DataTable summary)
        {
            DoBindingEditorPanel(gcDetailEditor, summary);
        }
 
        private void frmModuleMgr_Load(object sender, EventArgs e)
        {
            InitializeForm();
        }
 
        protected override void InitializeForm()
        {
            _SummaryView =
                new DevGridView(gvSummary); //给成员变量赋值.每个业务窗体必需给这个变量赋值.
            _ActiveEditor = txtFileName;
            _DetailGroupControl = gcDetailEditor;
            _BLL = new bllModuleMgr();
 
            base.InitializeForm();
        }
 
        // 检查主表数据是否完整或合法
        protected override bool ValidatingData()
        {
            AssertNull(txtSortID, "序号不能为空!");
            AssertNull(txtModuleID, "模块编号不能为空!");
            AssertNull(txtFileName, "文件名不能为空!");
            AssertNull(txtModuleName, "模块名不能为空!");
 
            if (_UpdateType == UpdateType.Add)
                if (_BLL.CheckNoExists(txtModuleID.Text))
                {
                    Msg.Warning("模块编号已存在!");
                    txtModuleID.Focus();
                    return false;
                }
 
            return true;
        }
    }
}