Пример #1
0
        private void ButtonEdit_Click(object sender, EventArgs e)
        {
            if (DataGridViewX1.SelectedRows.Count == 1)
            {
                //CustomDesktopAlert.H2(DataGridViewX1.SelectedRows[0].Cells["部门编号"].Value.ToString());
                int           selectedRowId = int.Parse(DataGridViewX1.SelectedRows[0].Cells["条目编号"].Value.ToString());
                FrmDictDetail frm           = new FrmDictDetail
                {
                    DictDataId    = selectedRowId,
                    DictTypeId    = int.Parse(advTree1.SelectedNode.Tag.ToString()),
                    StartPosition = FormStartPosition.CenterParent
                };

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    RefreshGridView();
                }
            }
            else if (DataGridViewX1.SelectedRows.Count > 1)
            {
                CustomDesktopAlert.H2("只能选择一行编辑");
            }
            else
            {
                CustomDesktopAlert.H2("请先选择要编辑的行");
            }
        }
Пример #2
0
        private void ButtonInsert_Click(object sender, EventArgs e)
        {
            FrmDictDetail frm = new FrmDictDetail
            {
                DictDataId    = -1,
                DictTypeId    = int.Parse(advTree1.SelectedNode.Tag.ToString()),
                StartPosition = FormStartPosition.CenterParent
            };

            if (frm.ShowDialog() == DialogResult.OK)
            {
                RefreshGridView();
            }
        }