Example #1
0
        public ActionResult SmestiZaliha()
        {
            smestiZaliha model = new smestiZaliha();

            model.magacini  = db.Magacins.ToList();
            model.primeroci = db.Primerok_Kniga.ToList();
            return(View(model));
        }
Example #2
0
 public ActionResult SmestiZaliha(smestiZaliha model)
 {
     if (ModelState.IsValid)
     {
         var primerok = db.Primerok_Kniga.Find(model.primerok_id);
         primerok.magacin_id      = model.magacin_id;
         db.Entry(primerok).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }