protected virtual bool DeleteObject(VideoRentBaseObject objectToDelete, string message, Action <object> action) { if (objectToDelete == null) { return(false); } return(ObjectHelper.SafeDelete(objectToDelete, message, ExceptionProcesser.Current, action)); }
protected virtual bool DeleteObject(VideoRentBaseObject objectToDelete, string message) { if (objectToDelete == null) { return(false); } return(ObjectHelper.SafeDeleteNoCommit(objectToDelete, message) != null); }
public static bool SafeDelete(VideoRentBaseObject obj, string shureToDeleteMessage, IExceptionProcesser exceptionProcesser, Action <object> action) { UnitOfWork uow = SafeDeleteNoCommit(obj, shureToDeleteMessage, action); if (uow == null) { return(false); } SessionHelper.CommitSession(uow, exceptionProcesser); return(true); }
public static UnitOfWork SafeDeleteNoCommit(VideoRentBaseObject obj, string shureToDeleteMessage, Action <object> action) { if (!obj.AllowDelete) { MessageBox.Show(ConstStrings.Get("ObjectCanNotBeDeleted"), ConstStrings.Get("Warning"), MessageBoxButton.OK, MessageBoxImage.Warning); return(null); } if (!IsSureToDelete(shureToDeleteMessage)) { return(null); } if (action != null) { action(null); } UnitOfWork uow = (UnitOfWork)obj.Session; obj.Delete(); return(uow); }
public static UnitOfWork SafeDeleteNoCommit(VideoRentBaseObject obj, string shureToDeleteMessage) { return(SafeDeleteNoCommit(obj, shureToDeleteMessage, null)); }
public static bool SafeDelete(VideoRentBaseObject obj, string shureToDeleteMessage, IExceptionProcesser exceptionProcesser) { return(SafeDelete(obj, shureToDeleteMessage, exceptionProcesser, null)); }