public ActionResult DeleteConfirmed(long id)
        {
            PRODAZHI prodazhi = db.PRODAZHI.Find(id);

            db.PRODAZHI.Remove(prodazhi);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        //
        // GET: /Prodazhi/Edit/5

        public ActionResult Edit(long id)
        {
            PRODAZHI prodazhi = db.PRODAZHI.Find(id);

            ViewBag.POKUPATEL = new SelectList(db.POKUPATELI, "ID", "IMJA_POKUPATELJA", prodazhi.POKUPATEL);
            ViewBag.PRODAVEC  = new SelectList(db.PRODAVCY, "ID", "IMJA_PRODAVCA", prodazhi.PRODAVEC);
            ViewBag.TOVAR     = new SelectList(db.SPISOK_TOVAROV, "ID", "TOVAR", prodazhi.TOVAR);
            return(View(prodazhi));
        }
 public ActionResult Edit(PRODAZHI prodazhi)
 {
     if (ModelState.IsValid)
     {
         db.Entry(prodazhi).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.POKUPATEL = new SelectList(db.POKUPATELI, "ID", "IMJA_POKUPATELJA", prodazhi.POKUPATEL);
     ViewBag.PRODAVEC  = new SelectList(db.PRODAVCY, "ID", "IMJA_PRODAVCA", prodazhi.PRODAVEC);
     ViewBag.TOVAR     = new SelectList(db.SPISOK_TOVAROV, "ID", "TOVAR", prodazhi.TOVAR);
     return(View(prodazhi));
 }
        //
        // GET: /Prodazhi/Details/5

        public ViewResult Details(long id)
        {
            PRODAZHI prodazhi = db.PRODAZHI.Find(id);

            return(View(prodazhi));
        }
        //
        // GET: /Prodazhi/Delete/5

        public ActionResult Delete(long id)
        {
            PRODAZHI prodazhi = db.PRODAZHI.Find(id);

            return(View(prodazhi));
        }