public ActionResult DeletePlanoPacienteConfirmed(int?IdPlanoAlimentar, String Login) { PlanoPaciente PlanoPaciente = db.PlanoPaciente.Where(a => a.IdPlanoAlimentar == IdPlanoAlimentar && a.Login == Login).FirstOrDefault(); db.PlanoPaciente.Remove(PlanoPaciente); db.SaveChanges(); return(RedirectToAction("PlanoPacienteIndex", new { id = PlanoPaciente.IdPlanoAlimentar })); }
public ActionResult CreatePlanoPaciente(int IdPlanoAlimentar) { PlanoPaciente plano = new PlanoPaciente { IdPlanoAlimentar = IdPlanoAlimentar }; return(View(plano)); }
public ActionResult CreatePlanoPaciente([Bind(Include = "IdPlanoAlimentar,Login")] PlanoPaciente PlanoPaciente) { if (ModelState.IsValid) { db.PlanoPaciente.Add(PlanoPaciente); db.SaveChanges(); return(RedirectToAction("PlanoPacienteIndex", new { id = PlanoPaciente.IdPlanoAlimentar })); } return(View(PlanoPaciente)); }
public ActionResult DeletePlanoPaciente(int?IdPlanoAlimentar, String Login) { if (IdPlanoAlimentar == null || Login == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PlanoPaciente PlanoPaciente = db.PlanoPaciente.Where(a => a.IdPlanoAlimentar == IdPlanoAlimentar && a.Login == Login).FirstOrDefault(); if (PlanoPaciente == null) { return(HttpNotFound()); } return(View(PlanoPaciente)); }