private void button1_Click(object sender, EventArgs e) { Regestration r = new Regestration(); button1.BackColor = Color.DarkRed; button1.ForeColor = Color.White; this.Hide(); r.Show(); }
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); }