Ejemplo n.º 1
0
        // GET: ProductType/Delete/5
        public ActionResult Delete(Nullable <short> id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Db          db          = new Db(DbServices.ConnectionString);
            ProductType productType = ProductTypeServices.Get(id.Value, db);

            if (productType == null)
            {
                return(HttpNotFound());
            }
            return(View(productType));
        }
Ejemplo n.º 2
0
        // GET: ProductType/Edit/5
        public ActionResult Edit(Nullable <short> id)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProductType productType = ProductTypeServices.Get(id.Value, db);

            if (productType == null)
            {
                return(HttpNotFound());
            }

            ViewBag.PaymentGroupList   = new SelectList(PaymentGroupServices.List(db), "Id", "Name", productType.PaymentGroup);
            ViewBag.ProfitStrategyList = new SelectList(ProfitStrategyServices.List(db), "Id", "Name", productType.ProfitStrategy);
            return(View(productType));
        }