Example #1
0
        //for image retrieving
        public ActionResult GetImage()
        {
            CapstoneDemoEntities db = new CapstoneDemoEntities();
            var item = (from d in db.Brands
                        select d).ToList();

            return(View(item));
        }
Example #2
0
        public ActionResult AddImage(Brand model, HttpPostedFileBase image1)
        {
            var db = new CapstoneDemoEntities();

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