public static RoleRPS GetRoleByUsername(string user) { RoleDataContext db = new RoleDataContext(); RoleRPS role = db.GetRoleByUsername(user); return(role); }
public static RoleRPS GetRole(int id) { RoleDataContext db = new RoleDataContext(); RoleRPS role = db.GetRole(id); return(role); }
public static List <RoleRPS> GetRoles() { RoleDataContext db = new RoleDataContext(); List <RoleRPS> roles = db.GetRoles(); return(roles); }
public static IEnumerable <AssignUserRole> GetRoleListFromDatabase() { RoleDataContext db = new RoleDataContext(); List <AssignUserRole> tempList = db.GetListActiveRoles(); return(tempList); }
public SelectList GetRoleList(int id) { List <AssignUserRole> roleList = AssignUserRole.GetRoleListFromDatabase().ToList(); RoleDataContext db = new RoleDataContext(); int selectedRole = db.GetRoleByUserID(id); List <SelectListItem> list = roleList.Select( y => new SelectListItem { Text = y.RoleName, Value = y.RoleID.ToString() }).ToList(); SelectList rle = new SelectList(list, "Value", "Text", selectedRole); return(rle); }
public static string GetRoleNameByRoleId(long lgRoleId) { try { using (objRoleContext = new RoleDataContext(StrConnection)) { var RoleData = objRoleContext.Roles.Where(x => x.Id == lgRoleId); if (RoleData != null) { return(RoleData.FirstOrDefault().RoleName); } else { return(""); } } } catch (Exception ex) { Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.Role, mySession.Current.UserId); return(null); } }
public int Update() { RoleDataContext db = new RoleDataContext(); return(db.UpdateRole(this)); }