public ActionResult DeleteConfirmed(int id) { OrdersOutModel ordersOutModel = db.OrdersOutModels.Find(id); db.OrdersOutModels.Remove(ordersOutModel); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,GoodId,DateOpen,ConterpartyId,Prise,Count,Summ")] OrdersOutModel ordersOutModel) { if (ModelState.IsValid) { db.Entry(ordersOutModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ConterpartyId = new SelectList(db.Conterparties, "Id", "Name", ordersOutModel.ConterpartyId); ViewBag.GoodId = new SelectList(db.GoodModels, "Id", "Name", ordersOutModel.GoodId); return(View(ordersOutModel)); }
// GET: OrdersOut/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OrdersOutModel ordersOutModel = db.OrdersOutModels.Find(id); if (ordersOutModel == null) { return(HttpNotFound()); } return(View(ordersOutModel)); }
// GET: OrdersOut/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OrdersOutModel ordersOutModel = db.OrdersOutModels.Find(id); if (ordersOutModel == null) { return(HttpNotFound()); } ViewBag.ConterpartyId = new SelectList(db.Conterparties, "Id", "Name", ordersOutModel.ConterpartyId); ViewBag.GoodId = new SelectList(db.GoodModels, "Id", "Name", ordersOutModel.GoodId); return(View(ordersOutModel)); }