public ActionResult DeleteConfirmed(int id)
        {
            OtherProducts otherProducts = db.OtherProducts.Find(id);

            db.OtherProducts.Remove(otherProducts);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,Name,Category,Material,Price,Quantity")] OtherProducts otherProducts)
 {
     if (ModelState.IsValid)
     {
         db.Entry(otherProducts).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(otherProducts));
 }
        public ActionResult Create([Bind(Include = "Id,Name,Category,Material,Price,Quantity")] OtherProducts otherProducts)
        {
            if (ModelState.IsValid)
            {
                db.OtherProducts.Add(otherProducts);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(otherProducts));
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OtherProducts otherProducts = db.OtherProducts.Find(id);

            if (otherProducts == null)
            {
                return(HttpNotFound());
            }
            return(View(otherProducts));
        }
 public ActionResult Index(OtherProducts otherProducts)
 {
     return(View());
 }
 public ProductCodeWindowViewModel(SainaDbContext uow)
 {
     ProductBrandsDropDownOpenedCommand = new RelayCommand(OnProductBrandsDropDownOpened, () => ProductBrands != null && ProductBrands.Any());
     ProductTypesDropDownOpenedCommand  = new RelayCommand(OnProductTypesDropDownOpened, () => ProductTypes != null && ProductTypes.Any());
     ProductModelsDropDownOpenedCommand = new RelayCommand(OnProductModelsDropDownOpened, () => ProductModels != null && ProductModels.Any());
     OtherProductsDropDownOpenedCommand = new RelayCommand(OnOtherProductsDropDownOpened, () => OtherProducts != null && OtherProducts.Any());
     _uow          = uow;
     ProductBrands = new ObservableCollection <ProductBrand>();
 }