public JsonResult DeleteItems(int id) { MultiPictureItems multiPictureItem = _multiPictureModuleService.GetItemsById(id); _multiPictureModuleService.DeleteItems(multiPictureItem); if (multiPictureItem.Image != "no-photo.jpg") { if (System.IO.File.Exists(Server.MapPath("/Content/Modules/Images/" + multiPictureItem.Image))) { System.IO.File.Delete(Server.MapPath("/Content/Modules/Images/" + multiPictureItem.Image)); } if (System.IO.File.Exists(Server.MapPath("/Content/Modules/Images/thumbnail/" + multiPictureItem.Image))) { System.IO.File.Delete(Server.MapPath("/Content/Modules/Images/thumbnail/" + multiPictureItem.Image)); } } return(Json(true, JsonRequestBehavior.AllowGet)); }
public JsonResult EditItems(MultiPictureItems multiPictureItems) { _multiPictureModuleService.EditItems(multiPictureItems); return(Json(true, JsonRequestBehavior.AllowGet)); }
public void EditItems(MultiPictureItems multiPictureItems) { _unitOfWork.MultiPictureItemsRepository.Update(multiPictureItems); _unitOfWork.Save(); }
public void DeleteItems(MultiPictureItems multiPictureItems) { _unitOfWork.MultiPictureItemsRepository.Delete(multiPictureItems); _unitOfWork.Save(); }
//MultiictureModuleItems public void CreateItems(MultiPictureItems multiPictureItems) { multiPictureItems.Image = "no-photo.jpg"; _unitOfWork.MultiPictureItemsRepository.Insert(multiPictureItems); _unitOfWork.Save(); }