Exemplo n.º 1
0
        public static RoleRPS GetRoleByUsername(string user)
        {
            RoleDataContext db   = new RoleDataContext();
            RoleRPS         role = db.GetRoleByUsername(user);

            return(role);
        }
Exemplo n.º 2
0
        public static RoleRPS GetRole(int id)
        {
            RoleDataContext db   = new RoleDataContext();
            RoleRPS         role = db.GetRole(id);

            return(role);
        }
Exemplo n.º 3
0
        //used in creating ModuleTree
        public static IEnumerable <ModuleRPS> GetListByUsername()
        {
            RoleRPS           role = RoleRPS.GetRoleByUsername(HttpContext.Current.User.Identity.Name);
            ModuleDataContext db   = new ModuleDataContext();

            //temporary fix <-- azrul, apesal getrolebyusername ni return null
            if (role == null)
            {
                role = new RoleRPS
                {
                    ID = 1
                };
            }
            List <ModuleRPS> tempList = db.GetListModules(role.ID);

            return(tempList);
        }