Exemplo n.º 1
0
 public int InsertRole(AdminRoles roles)
 {
     Logging.LogDebugMessage("Method: InsertRole ,MethodType: Post, Layer: RolesController, Parameters: roles = " + JsonConvert.SerializeObject(roles));
     using (RolesBL insertRole = new RolesBL())
     {
         return(insertRole.InsertRole(roles));
     }
 }
Exemplo n.º 2
0
 public AdminRoles GetRolesByName(string roleName)
 {
     Logging.LogDebugMessage("Method: GetRolesByName ,MethodType: Get, Layer: RolesController, Parameters: " + "roleName = " + roleName);
     using (RolesBL roleByName = new RolesBL())
     {
         return(roleByName.GetRolesByName(roleName));
     }
 }
Exemplo n.º 3
0
 public List <AdminRoles> GetAllActiveRoles()
 {
     Logging.LogDebugMessage("Method: GetAllActiveRoles, MethodType: Get, Layer: RolesController, Parameters: No Input Parameters");
     using (RolesBL activeRoles = new RolesBL())
     {
         return(activeRoles.GetAllActiveRoles());
     }
 }
Exemplo n.º 4
0
 /// <summary>This method deletes the selected roles.</summary>
 /// <param name="deletedRolesWithAdminUser">The DeletedRolesWithAdminUser Object.</param>
 /// <returns>List of Roles Object.</returns>
 public List <AdminRoles> DeleteRoles(DeletedRolesWithAdminUser deletedRolesWithAdminUser)
 {
     Logging.LogDebugMessage("Method: DeleteRoles, MethodType: Post, Layer: RolesController, Parameters: DeletedUsersWithAdminUser = " + JsonConvert.SerializeObject(deletedRolesWithAdminUser));
     using (RolesBL roleBL = new RolesBL())
     {
         return(roleBL.DeleteRoles(deletedRolesWithAdminUser));
     }
 }
Exemplo n.º 5
0
 public AdminRoles GetRolesById(int roleId)
 {
     Logging.LogDebugMessage("Method: GetRolesById ,MethodType: Get, Layer: RolesController, Parameters: " + "roleId = " + roleId.ToString());
     using (RolesBL roleById = new RolesBL())
     {
         return(roleById.GetRolesById(roleId));
     }
 }
Exemplo n.º 6
0
 public bool UpdateRole(AdminRoles role)
 {
     Logging.LogDebugMessage("Method: UpdateRole ,MethodType: Post, Layer: RolesController, Parameters:role = " + JsonConvert.SerializeObject(role));
     using (RolesBL updateRole = new RolesBL())
     {
         return(updateRole.UpdateRole(role));
     }
 }
Exemplo n.º 7
0
        private void CargarRoles(Int32 CodigoModulo)
        {
            RolesBL ObjetoRoles = new RolesBL();

            lbPermisos.DataSource    = ObjetoRoles.Listar(CodigoModulo);
            lbPermisos.DisplayMember = "Descripcion";
            lbPermisos.ValueMember   = "Codigo";
        }
Exemplo n.º 8
0
 public bool UserRoleInsertBulk(RoleObj roleObj)
 {
     Logging.LogDebugMessage("Method: UserRoleInsertBulk ,MethodType: Post, Layer: RolesController, Parameters: roleObj = " + JsonConvert.SerializeObject(roleObj));
     using (RolesBL userRoleInsert = new RolesBL())
     {
         List <InserRoleUser> insertroleuser = new List <InserRoleUser>();
         int CreatedByUserID = 0;
         insertroleuser  = roleObj.Insertroleuser;
         CreatedByUserID = roleObj.CreateUserId;
         return(userRoleInsert.UserRoleInsertBulk(insertroleuser, CreatedByUserID));
     }
 }
Exemplo n.º 9
0
        //get by user by username
        public ActionResult EditUser(string username)
        {
            User user = db.Users.Find(username);

            if (user == null)
            {
                return(HttpNotFound());
            }
            List <SelectListItem> usertype  = new List <SelectListItem>();
            IList <Role>          userTypes = new RolesBL().GetAllRoles().ToList();

            foreach (Role r in userTypes)
            {
                if (r.RoleID != 1)
                {
                    usertype.Add(new SelectListItem {
                        Text = r.RoleName, Value = r.RoleID.ToString()
                    });
                }
            }
            ViewData["usersList"] = usertype;
            return(View(user));
        }
        public void LoadDynamicMenu(string username, string PCC)
        {
            List <Rol> rolList = RolesBL.GetRolesByUser(username, PCC);

            roles = Array.ConvertAll <Rol, string>(rolList.ToArray(), delegate(Rol from) { return(from.RoleName.ToString()); });
            //roles = Roles.GetRolesForUser(username);
            //roles = new string[] { "admin", "" };
            List <ApplicationObjects> applicationObjects = MyCTS.Forms.UI.DataAccess.Security.GetMenuData();
            List <ApplicationObjects> parentObjects      = GetParents(applicationObjects);

            foreach (ApplicationObjects item in parentObjects)
            {
                ToolStripMenuItemExtended menu = new ToolStripMenuItemExtended();

                menu.Name     = item.Name;
                menu.Text     = item.Text;
                menu.Value    = item.ID.ToString();
                menu.Width    = 55;
                menu.AutoSize = false;
                this.Items.Add(menu);
                AddChild(applicationObjects, (ToolStripMenuItemExtended)this.Items[this.Items.Count - 1]);
            }
        }
Exemplo n.º 11
0
        public static FASM_Enums.InfoMessages DeleteRoles(Int32 RoleId)
        {
            RolesBL RolesBL = new RolesBL();

            return(RolesBL.DeleteRoles(RoleId));
        }
Exemplo n.º 12
0
        public static FASM_Enums.InfoMessages SaveRoles(ref Roles eRoles)
        {
            RolesBL RolesBL = new RolesBL();

            return(RolesBL.SaveRoles(ref eRoles));
        }
Exemplo n.º 13
0
        public static void LoadRoles(ref Roles eRoles)
        {
            RolesBL RolesBL = new RolesBL();

            RolesBL.LoadRoles(ref eRoles);
        }
Exemplo n.º 14
0
        public static DataTable ShowRoles(Int32 UserId)
        {
            RolesBL RolesBL = new RolesBL();

            return(RolesBL.ShowRoles(UserId));
        }
Exemplo n.º 15
0
        public static DataTable GetRoles()
        {
            RolesBL RolesBL = new RolesBL();

            return(RolesBL.GetRoles());
        }
Exemplo n.º 16
0
 public void Initialize()
 {
     tScope  = new TransactionScope();
     rolesBL = new RolesBL();
 }