public async Task <ActionResult> DeleteConfirmed(int id) { TypesNTCequipment typesNTCequipment = await db.TypesNTCequipment.FindAsync(id); db.TypesNTCequipment.Remove(typesNTCequipment); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "id_type_NTCequipment,name_type_NTCequipment")] TypesNTCequipment typesNTCequipment) { if (ModelState.IsValid) { db.Entry(typesNTCequipment).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(typesNTCequipment)); }
public async Task <ActionResult> Create([Bind(Include = "id_type_NTCequipment,name_type_NTCequipment")] TypesNTCequipment typesNTCequipment) { if (ModelState.IsValid) { db.TypesNTCequipment.Add(typesNTCequipment); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(typesNTCequipment)); }
//Action для сторінки деталей public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TypesNTCequipment typesNTCequipment = await db.TypesNTCequipment.FindAsync(id); if (typesNTCequipment == null) { return(HttpNotFound()); } return(View(typesNTCequipment)); }