Example #1
0
        public ActionResult Settings(Settings model)
        {
            HttpCookie c = new HttpCookie("NProject_culture", model.Language);
            c.Expires = DateTime.UtcNow.AddYears(1);
            Response.Cookies.Set(c);

            new UserService().UpdateUserProfile(SessionStorage.User.Id, model.FirstName, model.LastName, model.NewPassword, model.HoursOffsetFromUtc, model.Language);

            SessionStorage.User.UserName = new UserService().GetUser(SessionStorage.User.Id).Name;
            SessionStorage.User.HoursOffsetFromUtc = model.HoursOffsetFromUtc;

            SetTempMessage("Settings saved", "success");
            return RedirectToAction("Settings");
        }
Example #2
0
        public ActionResult Settings()
        {
            var us = new UserService().GetUser(SessionStorage.User.Id);

            var model = new Settings()
                            {
                                HoursOffsetFromUtc = us.HoursOffsetFromUtc,
                                FirstName = us.FirstName,
                                LastName = us.LastName,
                                Email = us.Email,
                                Language = us.Language
                            };
            return View(model);
        }