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