Beispiel #1
0
        public void EditOrder(int userId, Order order, OrderLumberLineItem[] lumberLineItems, OrderMiscellaneousLineItem[] miscLineItems)
        {
            var builder     = new EditOrderBuilder(userId, order, lumberLineItems, miscLineItems);
            var transaction = new TransactionalCommand(builder.Commands);

            transaction.Execute();
        }
Beispiel #2
0
        public void WarehouseReceivedOrder(int userId, Order order)
        {
            var builder     = new WarehouseReceviedOrderBuilder(userId, order);
            var transaction = new TransactionalCommand(builder.Commands);

            transaction.Execute();
        }
Beispiel #3
0
        public void DeleteOrder(int userId, Order order)
        {
            var builder     = new DeleteOrderBuilder(userId, order);
            var transaction = new TransactionalCommand(builder.Commands);

            transaction.Execute();
        }
Beispiel #4
0
        public void UpdateUserRoles(UserProfile user)
        {
            var builder     = new UpdateUserRolesBuilder(user);
            var transaction = new TransactionalCommand(builder.Commands);

            transaction.Execute();
        }
Beispiel #5
0
        public void SavePackages(int userId, Guid orderId, PackageLumberLineItem[] lumberLineItems, PackageMiscellaneousLineItem[] miscLineItems)
        {
            var builder     = new SavePackagesBuilder(userId, orderId, lumberLineItems, miscLineItems);
            var transaction = new TransactionalCommand(builder.Commands);

            transaction.Execute();
        }
Beispiel #6
0
        public void PullOrder(int userId, Guid orderId, int minutesTaken)
        {
            var builder     = new PullOrderBuilder(userId, orderId, minutesTaken);
            var transaction = new TransactionalCommand(builder.Commands);

            transaction.Execute();
        }
Beispiel #7
0
        public void InventoryAudit(int userId, TransactionTypes transactionType,
                                   LumberProduct[] lumberProducts, MiscellaneousProduct[] miscProducts)
        {
            var transactionTypeId = GetTransactionTypeIdByEnum(transactionType);
            var builder           = new InventoryAuditBuilder(userId, transactionTypeId, lumberProducts, miscProducts);
            var transaction       = new TransactionalCommand(builder.Commands);

            transaction.Execute();
        }
    public void DoSomethingTransactional()
    {
        var command = new TransactionalCommand();

        using (var scope = this.transactionManager.CreateScope(TransactionScopeOption.Required))
        {
            this.transactionManager.CurrentTransaction.EnlistVolatile(command, EnlistmentOptions.None);
            command.Execute();
            scope.Complete();
        }
    }
Beispiel #9
0
        public T CreateStep <T>(TransactionalCommand command) where T : TransactionStep, new()
        {
            T   step       = new T();
            int stepNumber = Steps.Count;

            step.StepNumber      = stepNumber;
            step.Command         = command;
            step.TransactionName = TransactionName;

            Steps.Add(step);
            return(step);
        }
Beispiel #10
0
        public void UpdatePackages(Package[] packages)
        {
            var transaction = new TransactionalCommand(packages.Select(p => new UpdatePackage(p)));

            transaction.Execute();
        }