public override void AddNew() { txtID.Text = "新ID"; txtSortCode.Text = ""; txtName.Text = ""; sbtnSave.Enabled = true; model = new RightingSys.Models.ACL_Role(); }
private void gvRole_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { if (RightIsChange && MessageBox.Show("授权信息改变是否保存?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { sbtnSaveFunc_Click(null, null); } RightIsChange = false; if (gvRole.FocusedRowHandle>=0) { RoleId = (Guid)gvRole.GetFocusedRowCellValue("Id"); model = RoleList.FirstOrDefault(s => s.Id == RoleId); gcUser.DataSource = roleMg.GetTbUsersByRoleId(RoleId); gcOU.DataSource = roleMg.GetTbDepartmentsByRoleId(RoleId); BuiderFuncTree(RoleId); sbtnSaveFunc.Enabled = sbtnReLoadFunc.Enabled = true; tlFunc.Caption = string.Format("当前选择的角色为:{0}",gvRole.GetFocusedRowCellValue("RoleName")); txtID.Text = model.Id.ToString(); txtName.Text = model.RoleName; txtSortCode.Text = model.SortCode; } }