public ActionResult DeleteConfirmed(int id) { PlanTrabajoDetalle planTrabajoDetalle = db.PlanTrabajoDetalle.Find(id); db.PlanTrabajoDetalle.Remove(planTrabajoDetalle); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { PlanTrabajoDetalle planTrabajoDetalle = db.PlanTrabajoDetalle.Find(id); int idPlan = planTrabajoDetalle.IdPlanTrabajo; db.PlanTrabajoDetalle.Remove(planTrabajoDetalle); db.SaveChanges(); return(RedirectToAction("Details", "PlanTrabajo", new { id = idPlan })); }
public ActionResult Edit([Bind(Include = "IdPlanTrabajoDet,IdPlanTrabajo,FechaAvance,porcentajePrevisto,porcentajeReal,porcentajeAtraso")] PlanTrabajoDetalle planTrabajoDetalle) { if (ModelState.IsValid) { db.Entry(planTrabajoDetalle).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdPlanTrabajo = new SelectList(db.PlanTrabajo, "IdPlanTrabajo", "IdPlanTrabajo", planTrabajoDetalle.IdPlanTrabajo); return(View(planTrabajoDetalle)); }
public ActionResult Create(PlanTrabajoDetalle planTrabajoDetalle) { if (ModelState.IsValid) { db.PlanTrabajoDetalle.Add(planTrabajoDetalle); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdPlanTrabajo = new SelectList(db.PlanTrabajo, "IdPlanTrabajo", "IdPlanTrabajo", planTrabajoDetalle.IdPlanTrabajo); return(View(planTrabajoDetalle)); }
public ActionResult Edit([Bind(Include = "IdPlanTrabajoDet,IdPlanTrabajo,FechaAvance,porcentajePrevisto,porcentajeReal,porcentajeAtraso")] PlanTrabajoDetalle planTrabajoDetalle) { if (ModelState.IsValid) { var plan = db.PlanTrabajo.Find(planTrabajoDetalle.IdPlanTrabajo); int periodo = MonthDifference(planTrabajoDetalle.FechaAvance, plan.FechaInicio); planTrabajoDetalle.numeroPeriodo = periodo + 1; db.Entry(planTrabajoDetalle).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Details", "PlanTrabajo", new { id = planTrabajoDetalle.IdPlanTrabajo })); } ViewBag.IdPlanTrabajo = new SelectList(db.PlanTrabajo, "IdPlanTrabajo", "IdPlanTrabajo", planTrabajoDetalle.IdPlanTrabajo); return(View(planTrabajoDetalle)); }
// GET: PlanTrabajoDetalles //public ActionResult Index() //{ // var planTrabajoDetalle = db.PlanTrabajoDetalle.Include(p => p.PlanTrabajo); // return View(planTrabajoDetalle.ToList()); //} // GET: PlanTrabajoDetalles/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PlanTrabajoDetalle planTrabajoDetalle = db.PlanTrabajoDetalle.Find(id); if (planTrabajoDetalle == null) { return(HttpNotFound()); } return(View(planTrabajoDetalle)); }
// GET: PlanTrabajoDetalles1/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PlanTrabajoDetalle planTrabajoDetalle = db.PlanTrabajoDetalle.Find(id); if (planTrabajoDetalle == null) { return(HttpNotFound()); } ViewBag.IdPlanTrabajo = new SelectList(db.PlanTrabajo, "IdPlanTrabajo", "IdPlanTrabajo", planTrabajoDetalle.IdPlanTrabajo); return(View(planTrabajoDetalle)); }