コード例 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmModuleAdd myfrmModuleAdd = new frmModuleAdd();

            if (myfrmModuleAdd.ShowDialog() == DialogResult.Yes)
            {
                frmModuleInfo_Load(sender, e);
            }
        }
コード例 #2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (gdcInfo.Nodes.Count > 0)
            {
                lstChecked = new List <string>();
                foreach (TreeListNode root in gdcInfo.Nodes)
                {
                    //获取根节点信息
                    if (root.CheckState == CheckState.Checked)
                    {
                        DataRowView drv = gdcInfo.GetDataRecordByNode(root) as DataRowView;
                        if (drv != null)
                        {
                            string menuid = drv["ID"].ToString();
                            lstChecked.Add(menuid);
                        }
                    }
                    GetCheckedID(root);
                }
            }
            if (lstChecked.Count() <= 0)
            {
                MessageBox.Show("请选择要选择的行!");
                return;
            }
            else if (lstChecked.Count() > 1)
            {
                MessageBox.Show("每次只能更新一个菜单!");
                return;
            }

            string       paramUserID    = lstChecked[0];
            frmModuleAdd myfrmModuleAdd = new frmModuleAdd(paramUserID);

            if (myfrmModuleAdd.ShowDialog() == DialogResult.Yes)
            {
                frmModuleInfo_Load(sender, e);
            }
        }