Пример #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "idActivity,state,start_date,end_date,Nombre, idCareer")] Activity activity)
 {
     if (ModelState.IsValid)
     {
         Activity actividad = db.Activity.Single(a => a.idActivity == activity.idActivity);
         actividad.Nombre  = activity.Nombre;
         actividad.Carrera = activity.Carrera;
         db.SaveChanges();
         db.Dispose();
         return(RedirectToAction("Index"));
     }
     ViewBag.idProcess = new SelectList(db.Process, "idProcess", "Criterio", activity.idProcess);
     ViewBag.idCareer  = new SelectList(db.Career, "idCareer", "Nombre");
     return(View(activity));
 }