public ActionResult Save(WhyUS newsAndEvents) { var res = _whyUsService.Save(newsAndEvents); return(Json(new Response { Success = res, Message = res ? Resource.SavedSuccessfully : Resource.ErrorsOccurred, Data = new { WhatWeDeliveredId = newsAndEvents.Id } })); }
public ActionResult SaveWhyUsPhoto(long whyusId) { var files = Request.Files; var uploaded = _fileService.UploadFile(MyConstants.UploadsPath, files[0]); WhyUS newsAndEvents = _whyUsService.FirstOrDefault(x => x.Id == whyusId); newsAndEvents.ImgUrl = uploaded.Path; _whyUsService.Update(newsAndEvents); _whyUsService.SaveChanges(); return(Json(true)); }