Esempio n. 1
0
        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);
        }
Esempio 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);
        }
Esempio n. 3
0
 public AddRole()
 {
     InitializeComponent();
     Roles = RoleSL.GetAllBind();
 }
Esempio n. 4
0
 public StartForm()
 {
     InitializeComponent();
     Roles = RoleSL.GetAllBind();
 }
Esempio n. 5
0
 public void GetRoles()
 {
     comboBox1.DisplayMember = "Role_Name";
     comboBox1.ValueMember   = "ID";
     comboBox1.DataSource    = RoleSL.GetAllBind();
 }