Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "userID,is_public,optIn,showEthnicity,showAge,showCountry,showGender,description,profileImgUrl")] UserProfile userProfile, [Bind(Include = "userID,firstName,lastName,ethnicity,birthdate,country,gender,")] UserInformation userInfo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userProfile).State = EntityState.Modified;
         db.Entry(userInfo).State    = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("UserProfile", new { id = userProfile.userID }));
     }
     ViewBag.userID = new SelectList(db.AspNetUsers, "Id", "Email", userProfile.userID);
     return(View(userProfile));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "usdaFoodID,userID")] SavedFood savedFood)
 {
     if (ModelState.IsValid)
     {
         db.Entry(savedFood).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(savedFood));
 }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "listID,userID,listName")] UserList userList)
 {
     userList.userID = User.Identity.GetUserId();
     if (ModelState.IsValid)
     {
         db.Entry(userList).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(userList));
 }