コード例 #1
0
        // GET: ProductTypeAvailability/Delete/5
        public ActionResult Delete(Nullable <int> id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Db db = new Db(DbServices.ConnectionString);
            ProductTypeAvailability productTypeAvailability = ProductTypeAvailabilityServices.Get(id.Value, db);

            if (productTypeAvailability == null)
            {
                return(HttpNotFound());
            }
            return(View(productTypeAvailability));
        }
コード例 #2
0
        // GET: ProductTypeAvailability/Edit/5
        public ActionResult Edit(Nullable <int> id)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProductTypeAvailability productTypeAvailability = ProductTypeAvailabilityServices.Get(id.Value, db);

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

            ViewBag.AvailabilityList = new SelectList(AvailabilityServices.List(db), "Id", "Name", productTypeAvailability.Availability);
            ViewBag.ProductTypeList  = new SelectList(ProductTypeServices.List(db), "Id", "Name", productTypeAvailability.ProductType);
            return(View(productTypeAvailability));
        }