static public void Delete(System.Int32 id, esSqlAccessType sqlAccessType) { var obj = new ProductPhoto(); obj.Id = id; obj.AcceptChanges(); obj.MarkAsDeleted(); obj.Save(sqlAccessType); }
public static bool DeletePhoto(int photoId) { ProductPhoto toDelete = new ProductPhoto(); if (toDelete.LoadByPrimaryKey(photoId)) { string filename = toDelete.Filename; toDelete.MarkAsDeleted(); toDelete.Save(); string deletePath = StoreUrls.GetProductPhotoFolderFileRoot() + filename; File.Delete(deletePath); return(true); } return(false); }