public async Task <ActionResult> DeleteConfirmed(int id) { Leprng leprng = await db.Leprngs.FindAsync(id); db.Leprngs.Remove(leprng); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Code,NameEN,NameKZ,NameRU")] Leprng leprng) { if (ModelState.IsValid) { db.Entry(leprng).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(leprng)); }
public async Task <ActionResult> Create([Bind(Include = "Id,Code,NameEN,NameKZ,NameRU")] Leprng leprng) { if (ModelState.IsValid) { db.Leprngs.Add(leprng); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(leprng)); }
public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Leprng leprng = await db.Leprngs.FindAsync(id); if (leprng == null) { return(HttpNotFound()); } return(View(leprng)); }