Exemplo n.º 1
0
        public ActionResult Me(UserUpdate changes)
        {
            ///update the data and return to previous url or something?
            FilmTroveContext ftc = (FilmTroveContext)HttpContext.Items["ftcontext"];
            UserProfile up = ftc.UserProfiles.Find(WebSecurity.CurrentUserId);
            up.Name = changes.Name;
            up.Email = changes.Email;

            ftc.SaveChanges();

            return View("Me", changes);
        }
Exemplo n.º 2
0
        public ActionResult NetflixUnlink()
        {
            FilmTroveContext ftc = (FilmTroveContext)HttpContext.Items["ftcontext"];

            UserProfile up = ftc.UserProfiles.Find(WebSecurity.CurrentUserId);
            up.NetflixAccount.Token = "";
            up.NetflixAccount.TokenSecret = "";
            up.NetflixAccount.UserId = "";
            Int32 changed = ftc.SaveChanges();

            UserUpdate userupdate = new UserUpdate(up);

            ViewBag.NetflixLinked = null;
            return View("Me", userupdate);
        }
Exemplo n.º 3
0
        public ActionResult Me()
        {
            if (WebSecurity.IsAuthenticated)
            {
                FilmTroveContext ftc = (FilmTroveContext)HttpContext.Items["ftcontext"];
                UserProfile up = ftc.UserProfiles.Find(WebSecurity.CurrentUserId);
                if (up.NetflixAccount.UserId != null && up.NetflixAccount.UserId != "")
                    ViewBag.NetflixLinked = true;
                UserUpdate userupdate = new UserUpdate(up);

                return View(userupdate);

            }
            return View();
        }