public frmAreaEdit(frmAreaSet _frmAreaSet, SysUser _User, string _ParentCode, string _PrimaryKey, int _OperationType) { InitializeComponent(); PrimaryKey = _PrimaryKey; OperationType = _OperationType; User = _User; frmParent = _frmAreaSet; ParentCode = _ParentCode; loadDropdownData(); //新增 if (OperationType == 1) { if (string.IsNullOrEmpty(ParentCode) || ParentCode == "00") { A_Parent.SelectedIndex = -1; } else { A_Parent.SelectedValue = ParentCode; } } //修改 if (OperationType == 2) { getDetail(); this.A_Code.ReadOnly = true; } }
private void cmsArea_Click(object sender, EventArgs e) { frmAreaSet frmArea = new frmAreaSet(this); frmArea.WindowState = FormWindowState.Maximized; foreach (DockContent frm in this.panMain.Contents) { if (frm.Name == frmArea.Name) { frm.Activate();//激活 return; } } frmArea.Show(this.panMain); }