Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "UserId,FirstName,LastName,Address,TelephoneNumber,Email")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "HealthRecordId,UserId,Age,Weight,Height,BMR,BMI,KCAL,TargetBMI")] HealthRecord healthRecord)
 {
     if (ModelState.IsValid)
     {
         db.Entry(healthRecord).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.Users, "UserId", "FirstName", healthRecord.UserId);
     return(View(healthRecord));
 }