Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,userId,planType")] Plans plans)
 {
     if (ModelState.IsValid)
     {
         db.Entry(plans).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(plans));
 }
 public ActionResult Edit([Bind(Include = "Id,date,foodName,calorie,PlansId")] Schedule schedule)
 {
     if (ModelState.IsValid)
     {
         db.Entry(schedule).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PlansId = new SelectList(db.Plans, "Id", "userId", schedule.PlansId);
     return(View(schedule));
 }