private bool IsExistRole(string role) { TRoleManager roleManager = new TRoleManager(); var count = roleManager.GetRowCountByWhere($"where UserRole='{role}'"); if (count > 0) { return(true); } return(false); }
private void RoleManager_Load(object sender, EventArgs e) { this.roleManager = new TRoleManager(); this.roleEntity = new TRole(); QueryRoleInfo(); this.menu_add.Click += Menu_add_Click; this.menu_commit.Click += Menu_commit_Click; this.menu_del.Click += Menu_del_Click; this.menu_refresh.Click += Menu_refresh_Click; }
private void LimmitManager_Load(object sender, EventArgs e) { this.dicFuncLimitPairs = new Dictionary <string, int>(); this.dicOperateLimitPairs = new Dictionary <string, int>(); this.funLimitManager = new FuncLimitManager(); this.operatLimitManager = new OperatLimitManager(); this.roleManager = new TRoleManager(); Init(); this.btn_cancel.Click += Btn_cancel_Click; this.btn_ok.Click += Btn_ok_Click; this.checkAllFunc.CheckStateChanged += CheckAllFunc_CheckStateChanged; this.checkAllOperat.CheckStateChanged += CheckAllOperat_CheckStateChanged; this.cob_roleList.SelectedIndexChanged += Cob_roleList_SelectedIndexChanged; }
public static long InsertRolePID() { long id = -1; TRoleManager objManager = new TRoleManager(); var dt = objManager.GetDataSetByWhere("order by ID DESC limit 1").Tables[0]; if (dt.Rows.Count < 1) { return(0); } if (long.TryParse(dt.Rows[0]["ID"].ToString(), out id)) { return(id + 1); } return(id); }
private void AddUserRole() { TRoleManager roleManager = new TRoleManager(); this.cb_userType.MultiColumnComboBoxElement.Columns.Add("NAME"); var data = roleManager.GetDataSetByFieldsAndWhere("distinct UserRole", "where UserRole != '管理员'").Tables[0]; if (data.Rows.Count <= 0) { return; } foreach (DataRow dr in data.Rows) { this.cb_userType.EditorControl.Rows.Add(dr[0].ToString()); } this.cb_userType.EditorControl.ShowColumnHeaders = false; this.cb_userType.EditorControl.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; if (this.cb_userType.EditorControl.Rows.Count > 0) { this.cb_userType.SelectedIndex = 0; } }