Ejemplo n.º 1
0
 public PartialViewResult Edit(int? id)
 {
     var activity = new Activity();
     if (id != null)
     {
         activity = _db.Activities.Find(id);
     }
     ViewBag.Status = activity.Status.ToSelectList();
     return PartialView(activity);
 }
Ejemplo n.º 2
0
 public JsonResult Edit(Activity activity)
 {
     if (activity.IsNew)
     {
         _db.Entry(activity).State = System.Data.EntityState.Added;
     }
     else
     {
         _db.Entry(activity).State = System.Data.EntityState.Modified;
     }
     _db.SaveChanges();
     return GetErrorMsgJSON();
 }