Exemplo n.º 1
0
 protected virtual bool DeleteObject(VideoRentBaseObject objectToDelete, string message, Action <object> action)
 {
     if (objectToDelete == null)
     {
         return(false);
     }
     return(ObjectHelper.SafeDelete(objectToDelete, message, ExceptionProcesser.Current, action));
 }
Exemplo n.º 2
0
 protected virtual bool DeleteObject(VideoRentBaseObject objectToDelete, string message)
 {
     if (objectToDelete == null)
     {
         return(false);
     }
     return(ObjectHelper.SafeDeleteNoCommit(objectToDelete, message) != null);
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 public static UnitOfWork SafeDeleteNoCommit(VideoRentBaseObject obj, string shureToDeleteMessage)
 {
     return(SafeDeleteNoCommit(obj, shureToDeleteMessage, null));
 }
Exemplo n.º 6
0
 public static bool SafeDelete(VideoRentBaseObject obj, string shureToDeleteMessage, IExceptionProcesser exceptionProcesser)
 {
     return(SafeDelete(obj, shureToDeleteMessage, exceptionProcesser, null));
 }