public async Task <ActionResult> DeleteConfirmed(int id) { BodyOrder bodyOrder = await db.BodyOrders.FindAsync(id); db.BodyOrders.Remove(bodyOrder); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,HeadOrderId,ServiceId,Price,Count,Sum")] BodyOrder bodyOrder) { if (ModelState.IsValid) { db.Entry(bodyOrder).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(bodyOrder)); }
public async Task <ActionResult> Create([Bind(Include = "Id,HeadOrderId,ServiceId,Price,Count,Sum")] BodyOrder bodyOrder) { if (ModelState.IsValid) { db.BodyOrders.Add(bodyOrder); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(bodyOrder)); }
// GET: BodyOrders/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BodyOrder bodyOrder = await db.BodyOrders.FindAsync(id); if (bodyOrder == null) { return(HttpNotFound()); } return(View(bodyOrder)); }