Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Regestration r = new Regestration();

            button1.BackColor = Color.DarkRed;
            button1.ForeColor = Color.White;

            this.Hide();
            r.Show();
        }
Exemplo n.º 2
0
        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);
        }