Ejemplo n.º 1
0
        public int CreateMaterialMemento(CreateMaterialMementoCommand createMaterialMementoCommand)
        {
            var model = _mapper.Map <MaterialMemento>(createMaterialMementoCommand);

            _supplyContext.Add(model);
            _supplyContext.SaveChanges();
            return(model.MaterialMementoId);
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "ProductID,Name")] Product product)
        {
            if (ModelState.IsValid)
            {
                db.Products.Add(product);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(product));
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
 public void Save()
 {
     supplyDbContext.SaveChanges();
 }