Ejemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var edit = new RoleEdit();

            if (edit.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(300);
                cmd.ShowOpaqueLayer();
                SearchData();
                MessageBoxUtils.Hint("保存成功!", MainForm);
            }
        }
Ejemplo n.º 2
0
        private void btnUp_Click(object sender, EventArgs e)
        {
            var selectedRow = gvRole.GetFocusedRow() as RoleEntity;

            if (selectedRow == null)
            {
                return;
            }
            var        edit = new RoleEdit();
            RoleEntity role = new RoleEntity();

            role.id   = selectedRow.id;
            edit.role = role;
            edit.Text = "角色修改";
            if (edit.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(300);
                cmd.ShowOpaqueLayer();
                SearchData();
                MessageBoxUtils.Hint("修改成功!", MainForm);
            }
        }
Ejemplo n.º 3
0
 private void gvRole_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     if (e.Column.Caption != "操作")
     {
         var selectedRow = gvRole.GetFocusedRow() as RoleEntity;
         if (selectedRow == null)
         {
             return;
         }
         var        edit = new RoleEdit();
         RoleEntity role = new RoleEntity();
         role.id   = selectedRow.id;
         edit.role = role;
         edit.Text = "角色修改";
         if (edit.ShowDialog() == DialogResult.OK)
         {
             Thread.Sleep(300);
             cmd.ShowOpaqueLayer();
             SearchData();
             MessageBoxUtils.Hint("修改成功!", MainForm);
         }
     }
 }