public async Task <ActionResult> DeleteConfirmed(int id) { RECEPTA recepta = await db.RECEPTY.FindAsync(id); db.RECEPTY.Remove(recepta); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "DATA_WYKORZYSTANIA,NAZWA_LEKU,UWAGI")] RECEPTA recepta) { if (ModelState.IsValid) { db.Entry(recepta).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(recepta)); }
public async Task <ActionResult> Create([Bind(Include = "DATA_WYKORZYSTANIA,NAZWA_LEKU,UWAGI")] RECEPTA recepta) { if (ModelState.IsValid) { db.RECEPTY.Add(recepta); await db.SaveChangesAsync(); ViewBag.ID_LEKU = new MultiSelectList(db.LEKI, "ID_LEKU", "NAZWA_LEKU"); return(RedirectToAction("Index")); } return(View(recepta)); }
// GET: Recepta/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RECEPTA recepta = await db.RECEPTY.FindAsync(id); if (recepta == null) { return(HttpNotFound()); } return(View(recepta)); }