Exemplo n.º 1
0
        public ActionResult Index(HttpPostedFileBase postedFile)
        {
            byte[] bytes;
            using (BinaryReader br = new BinaryReader(postedFile.InputStream))
            {
                bytes = br.ReadBytes(postedFile.ContentLength);
            }


            //Save
            var model = new SporcuFoto {
                Name        = Path.GetFileName(postedFile.FileName),
                ContentType = postedFile.ContentType,
                Data        = bytes
            };

            _sporcuFotoService.Add(model);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public SporcuFoto Update(SporcuFoto sporcuFoto)
 {
     return(_sporcuFotoDal.Update(sporcuFoto));
 }
Exemplo n.º 3
0
 public SporcuFoto Add(SporcuFoto sporcuFoto)
 {
     return(_sporcuFotoDal.Add(sporcuFoto));
 }