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