예제 #1
0
파일: BasicList.cs 프로젝트: sishui198/MMS
        private void 编辑ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                int    parentId   = int.Parse(this.tl_dict.FocusedNode.GetValue("ID").ToString());
                string parentName = this.tl_dict.FocusedNode.GetValue("MenuName").ToString();

                var frm = new BasicDetail
                {
                    parentId   = parentId,
                    parentName = parentName,
                    id         = Convert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Id")),
                    name       = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Name").ToString()
                };
                if (DialogResult.OK == frm.ShowDialog())
                {
                    tl_dict_FocusedNodeChanged(null, null);
                }
                else
                {
                    XtraMessageBox.Show("编辑失败!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("编辑出错!" + ex.Message);
            }
        }
예제 #2
0
파일: BasicList.cs 프로젝트: sishui198/MMS
        private void btn_Add_Click(object sender, EventArgs e)
        {
            try
            {
                int    parentId   = int.Parse(this.tl_dict.FocusedNode.GetValue("ID").ToString());
                string parentName = this.tl_dict.FocusedNode.GetValue("MenuName").ToString();

                if (parentId > 0)
                {
                    var frm = new BasicDetail
                    {
                        parentId   = parentId,
                        parentName = parentName
                    };

                    if (DialogResult.OK == frm.ShowDialog())
                    {
                        tl_dict_FocusedNodeChanged(null, null);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }