public string GetRolesOfUser(int userid, bool IsActive) { MPOEntities myen = SessionHelpers.GetContext(HttpContext.Current.Session); StoreProcedureHelpers sph = new StoreProcedureHelpers(); return(sph.GetRolesOfUser(myen, userid, IsActive)); }
public List <Entity> GetEntities_Right(int RoleId, string ServiceName) { MPOEntities myen = SessionHelpers.GetContext(HttpContext.Current.Session); List <Entity> getright = myen.Right_EntityGet(RoleId, ServiceName).ToList <Entity>(); return(getright); }
public bool ValidEntity_Right(string roles, string ServiceName, string EntityName) { using (var myen = SessionHelpers.GetContext(HttpContext.Current.Session)) { int result = myen.Right_EntityValidRoles(roles, ServiceName, EntityName).FirstOrDefault().Value; return(result == 1 ? true : false); } }
public List <Role> Roles_Get() { global::AccessManagementService.Model.User user = SessionHelpers.GetUser(HttpContext.Current.Session); if (user == null) { return(null); } int userid = user.ID; myen = SessionHelpers.GetContext(HttpContext.Current.Session); return(myen.ListRolesOfUser(userid, true).ToList <Role>()); }
public void LogOutUser() { using (var myen = SessionHelpers.GetContext(HttpContext.Current.Session)) { User user = Helpers.SessionHelpers.GetUser(HttpContext.Current.Session); if (user != null) { myen.DoLogout(user.ID); HttpContext.Current.Session.RemoveAll(); } FormsAuthentication.RedirectToLoginPage(); } }
public void LoginUser(int UserId, string UserName, bool Persist) { Entity ent = new Entity(); MPOEntities myen = SessionHelpers.GetContext(HttpContext.Current.Session); User user = new User(); // myen.DoLogin(UserId, TCPIPHelpers.UserIPAddress, TCPIPHelpers.UserSessionId); string roles = user.GetRolesOfUser(UserId, true); user = user.GetUserById(UserId, new [] { "Department" }); SetSessions(roles, user); FormsAuthentication.RedirectFromLoginPage(UserName, Persist); }