public ActionResult CreateFile(T_Carousel carousel) { var file = Request.Files["file"]; dbContent.Entry(carousel).State = EntityState.Added; carousel.Path = SaveFile(file); dbContent.SaveChanges(); return(Ok()); }
public ActionResult GetHomeImg(string type, LanguageModel langId) { var model = dbContent.Carousels.FirstOrDefault(x => x.Type == type); if (model == null) { model = new T_Carousel(); } Translate(model, langId); return(JsonMode(model)); }
public ActionResult ModifyFile(T_Carousel carousel) { var file = Request.Files["file"]; if (file != null && file.ContentLength > 0) { carousel.Path = SaveFile(file); } dbContent.Entry(carousel).State = EntityState.Modified; dbContent.SaveChanges(); return(Ok()); }