public ActionResult Create(Prodaj_Product prodaja)
 {
     //Добавляем игрока в таблицу
     db.Prodaj_Products.Add(prodaja);
     db.SaveChanges();
     // перенаправляем на главную страницу
     return(RedirectToAction("Index"));
 }
        public ActionResult Delete(int id)
        {
            Prodaj_Product b = db.Prodaj_Products.Find(id);

            if (b == null)
            {
                return(HttpNotFound());
            }
            return(View(b));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Prodaj_Product b = db.Prodaj_Products.Find(id);

            if (b == null)
            {
                return(HttpNotFound());
            }
            db.Prodaj_Products.Remove(b);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }
            Prodaj_Product Prodaj_Product = db.Prodaj_Products.Find(id);

            if (Prodaj_Product != null)
            {
                SelectList prodajs = new SelectList(db.Gotov_Products, "gp_ID", "name");
                ViewBag.Gotov_Products = prodajs;
                SelectList sotrudniks = new SelectList(db.Sotrudniks, "sotr_ID", "FIO");
                ViewBag.Sotrudniks = sotrudniks;
                return(View(Prodaj_Product));
            }
            return(HttpNotFound());
        }
 public ActionResult Edit(Prodaj_Product Prodaj_Product)
 {
     db.Entry(Prodaj_Product).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }