Exemple #1
0
        public ActionResult AddImage(tblKomadNamestaja model, HttpPostedFileBase image1)
        {
            var db = new ProdavnicaNamestajaEntities();

            if (image1 != null)
            {
                model.Slika = new byte[image1.ContentLength];
                image1.InputStream.Read(model.Slika, 0, image1.ContentLength);
            }
            db.tblKomadNamestajas.Add(model);
            db.SaveChanges();
            return(View(model));
        }