Exemplo n.º 1
0
        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 }));
        }
Exemplo n.º 2
0
        public ActionResult CreatePlanoPaciente(int IdPlanoAlimentar)
        {
            PlanoPaciente plano = new PlanoPaciente
            {
                IdPlanoAlimentar = IdPlanoAlimentar
            };

            return(View(plano));
        }
Exemplo n.º 3
0
 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));
 }
Exemplo n.º 4
0
        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));
        }