public int CreateMaterialMemento(CreateMaterialMementoCommand createMaterialMementoCommand) { var model = _mapper.Map <MaterialMemento>(createMaterialMementoCommand); _supplyContext.Add(model); _supplyContext.SaveChanges(); return(model.MaterialMementoId); }
public ActionResult Create([Bind(Include = "ProductID,Name")] Product product) { if (ModelState.IsValid) { db.Products.Add(product); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(product)); }
public ActionResult Create([Bind(Include = "ID,LocationName,CustomerName")] Location location) { if (ModelState.IsValid) { db.Locations.Add(location); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(location)); }
public ActionResult Create([Bind(Include = "OrderID,OrderDate,Quantity,ProductID,LocationID,Status")] Order order) { if (ModelState.IsValid) { db.Orders.Add(order); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.LocationID = new SelectList(db.Locations, "ID", "LocationName", order.LocationID); ViewBag.ProductID = new SelectList(db.Products, "ProductID", "Name", order.ProductID); return(View(order)); }
public void Save() { supplyDbContext.SaveChanges(); }