public async Task <ActionResult> DeleteConfirmed(long id) { RecetaMedicaMaterial recetaMedicaMaterial = await db.RecetaMedicaMaterial.FindAsync(id); db.RecetaMedicaMaterial.Remove(recetaMedicaMaterial); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,RecetaMedica,Material,Cantidad")] RecetaMedicaMaterial recetaMedicaMaterial) { if (ModelState.IsValid) { db.Entry(recetaMedicaMaterial).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.Material = new SelectList(db.Material, "Id", "Codigo", recetaMedicaMaterial.Material); ViewBag.RecetaMedica = new SelectList(db.RecetaMedica, "Id", "Descripcion", recetaMedicaMaterial.RecetaMedica); return(View("/Views/Administrativas/RecetaMedicaMaterials/Edit.cshtml", recetaMedicaMaterial)); }
// GET: RecetaMedicaMaterials/Details/5 public async Task <ActionResult> Details(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RecetaMedicaMaterial recetaMedicaMaterial = await db.RecetaMedicaMaterial.FindAsync(id); if (recetaMedicaMaterial == null) { return(HttpNotFound()); } return(View("/Views/Administrativas/RecetaMedicaMaterials/Details.cshtml", recetaMedicaMaterial)); }
// GET: RecetaMedicaMaterials/Edit/5 public async Task <ActionResult> Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RecetaMedicaMaterial recetaMedicaMaterial = await db.RecetaMedicaMaterial.FindAsync(id); if (recetaMedicaMaterial == null) { return(HttpNotFound()); } ViewBag.Material = new SelectList(db.Material, "Id", "Codigo", recetaMedicaMaterial.Material); ViewBag.RecetaMedica = new SelectList(db.RecetaMedica, "Id", "Descripcion", recetaMedicaMaterial.RecetaMedica); return(View("/Views/Administrativas/RecetaMedicaMaterials/Edit.cshtml", recetaMedicaMaterial)); }