Beispiel #1
0
        public static bool Remove <T>(T albianObject)
            where T : class, IAlbianObject
        {
            if (null == albianObject)
            {
                throw new ArgumentNullException("albianObject");
            }
            TaskBuilder builder           = new TaskBuilder();
            ITask       task              = builder.BuildRemoveTask(albianObject);
            ITransactionClusterScope tran = new TransactionClusterScope();

            return(tran.Execute(task));
        }
Beispiel #2
0
        public static bool Create <T>(T albianObject)
            where T : class, IAlbianObject
        {
            if (null == albianObject)
            {
                throw new ArgumentNullException("albianObject");
            }
            TaskBuilder builder           = new TaskBuilder();
            ITask       task              = builder.BuildCreateTask(albianObject);
            ITransactionClusterScope tran = new TransactionClusterScope();
            bool isSuccess = tran.Execute(task);

            if (!isSuccess)
            {
                return(isSuccess);
            }
            ResultCache.CachingObject(albianObject);
            return(isSuccess);
        }
Beispiel #3
0
        public static bool Modify <T>(IList <T> albianObjects)
            where T : class, IAlbianObject
        {
            if (null == albianObjects)
            {
                throw new ArgumentNullException("albianObjects");
            }
            if (0 == albianObjects.Count)
            {
                throw new ArgumentException("albianObject count is 0.");
            }
            TaskBuilder builder           = new TaskBuilder();
            ITask       task              = builder.BuildModifyTask(albianObjects);
            ITransactionClusterScope tran = new TransactionClusterScope();
            bool isSuccess = tran.Execute(task);

            if (!isSuccess)
            {
                return(isSuccess);
            }
            ResultCache.CachingObjects(albianObjects);
            return(isSuccess);
        }