Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ProductInWork productInWork = _warehouseUow.ProductInWorks.GetById(id);

            _warehouseUow.ProductInWorks.Delete(productInWork);
            _warehouseUow.Commit();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit(ProductInWork productInWork)
 {
     if (ModelState.IsValid)
     {
         _warehouseUow.ProductInWorks.Update(productInWork);
         _warehouseUow.Commit();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProductId  = new SelectList(_warehouseUow.Products.All, "ProductId", "Description", productInWork.ProductId);
     ViewBag.WorkTypeId = new SelectList(_warehouseUow.WorkTypes.All, "WorkTypeId", "Description", productInWork.WorkTypeId);
     return(View(productInWork));
 }
Exemplo n.º 3
0
        // GET: ProductInWorks/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProductInWork productInWork = _warehouseUow.ProductInWorks.GetById(id);

            if (productInWork == null)
            {
                return(HttpNotFound());
            }
            return(View(productInWork));
        }
Exemplo n.º 4
0
        // GET: ProductInWorks/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProductInWork productInWork = _warehouseUow.ProductInWorks.GetById(id);

            if (productInWork == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ProductId  = new SelectList(_warehouseUow.Products.All, "ProductId", "Description", productInWork.ProductId);
            ViewBag.WorkTypeId = new SelectList(_warehouseUow.WorkTypes.All, "WorkTypeId", "Description", productInWork.WorkTypeId);
            return(View(productInWork));
        }