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