Пример #1
0
        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));
        }
Пример #2
0
 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));
     }
 }
Пример #3
0
        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));
            }
        }
Пример #4
0
        // 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()));
        }