public JsonResult OnCurrencyChanged(BusinessLibrary.ViewModels.UserDashboardViewModel ud) { Session session = Helpers.AuthenticationHelper.GetSession(System.Web.HttpContext.Current); BusinessLibrary.Library.UserSelfAdministrationLibrary uLib = new BusinessLibrary.Library.UserSelfAdministrationLibrary(System.Web.HttpContext.Current, session); return(Json(uLib.GetUserDashboardFromViewModel(ud), JsonRequestBehavior.AllowGet)); }
public JsonResult SaveProfile(BusinessLibrary.ViewModels.UserDashboardViewModel ud) { try { Session session = Helpers.AuthenticationHelper.GetSession(System.Web.HttpContext.Current); BusinessLibrary.Library.UserSelfAdministrationLibrary uLib = new BusinessLibrary.Library.UserSelfAdministrationLibrary(System.Web.HttpContext.Current, session); uLib.SaveUserProfile(ud); return(Json(new { StatusKey = "SUCCESS" }, JsonRequestBehavior.AllowGet)); } catch { return(Json(new { StatusKey = "ERROR" }, JsonRequestBehavior.AllowGet)); } }
public JsonResult CheckEmail(string Email) { Session session = Helpers.AuthenticationHelper.GetSession(System.Web.HttpContext.Current); UserRegistrationLibrary lib = new UserRegistrationLibrary(); BusinessLibrary.Library.UserSelfAdministrationLibrary uLib = new BusinessLibrary.Library.UserSelfAdministrationLibrary(System.Web.HttpContext.Current, session); if (Email == uLib.GetCurrentSavedEmail()) { return(Json(new { Valid = true }, JsonRequestBehavior.AllowGet)); } else if (!lib.IsEmailTaken(Email)) { return(Json(new { Valid = true }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { Valid = false }, JsonRequestBehavior.AllowGet)); } }
// GET: UserDashboard public ActionResult Index() { Session session = Helpers.AuthenticationHelper.GetSession(System.Web.HttpContext.Current); if (!User.Identity.IsAuthenticated) { return(RedirectToAction("Index", "AccessDenied", new { area = "" })); } else { if (session.UserID == "" || session.UserID == null) { Helpers.AuthenticationHelper.RebuildSessionForUserLogIn(System.Web.HttpContext.Current, User.Identity.Name, true); } } BusinessLibrary.Library.UserSelfAdministrationLibrary uLib = new BusinessLibrary.Library.UserSelfAdministrationLibrary(System.Web.HttpContext.Current, session); return(View("~/Views/UserManagement/UserDashboard.cshtml", uLib.GetUserDashboardInformation())); }