private void button2_Click(object sender, EventArgs e) { int role_id = Int32.Parse(Role_Id.Text); DataRow role_Dr = RoleSL.GetById(role_id); Entities.Role role = RoleSL.GetRole(role_Dr); Result.Text = string.Format("Role Id : {0} \nRole Name : {1}", role.Id, role.Role_Name); }
private bool CheckIfAdmin() { int userRoleId = Regestration.CurrentUser.Role_Id; int admin_role = (int)Role.Admin; Entities.Role AdminRole = RoleSL.GetRole(RoleSL.GetById(admin_role)); Entities.Role UserRole = RoleSL.GetRole(RoleSL.GetById(userRoleId)); string AdminRole_name = Regestration.SplitSpaces(AdminRole.Role_Name); string userRole_name = Regestration.SplitSpaces(UserRole.Role_Name); if (AdminRole_name == userRole_name) { return(true); } return(false); }
public AddRole() { InitializeComponent(); Roles = RoleSL.GetAllBind(); }
public StartForm() { InitializeComponent(); Roles = RoleSL.GetAllBind(); }
public void GetRoles() { comboBox1.DisplayMember = "Role_Name"; comboBox1.ValueMember = "ID"; comboBox1.DataSource = RoleSL.GetAllBind(); }