public OrderBuilderTestContext WithProductTimer()
 {
     ProductTimer = new ProductTimer {
         Id = 12
     };
     return(this);
 }
示例#2
0
 public void UpdateProductTimer(ProductTimer timer)
 {
     if (timer != null)
     {
         ProductTimerValue = new ProductTimerValue
         {
             ProductTimerId = timer.Id,
             MinTime        = timer.MinTime,
             PriceType      = timer.PriceType,
             PriceDuration  = timer.PriceDuration,
             TimeRounding   = timer.TimeRounding,
         };
     }
 }
示例#3
0
 public void UpdateProductTimer(ProductTimer timer)
 {
     if (timer != null)
     {
         ProductTimerValue = new ProductTimerValue
         {
             ProductTimerId = timer.Id,
             MinTime        = timer.MinTime,
             PriceType      = timer.PriceType,
             PriceDuration  = timer.PriceDuration,
             TimeRounding   = timer.TimeRounding,
         };
         if (timer.StartTime > 0)
         {
             var now = DateTime.Today;
             ProductTimerValue.Start = new DateTime(now.Year, now.Month, now.Day, timer.StartTime, 0, 0);
             ProductTimerValue.End   = ProductTimerValue.Start;
         }
     }
     else
     {
         ProductTimerValue = null;
     }
 }
示例#4
0
        public Order AddOrder(AccountTransactionType template, Department department, string userName, MenuItem menuItem, IList <TaxTemplate> taxTemplates, MenuItemPortion portion, string priceTag, ProductTimer timer)
        {
            UnLock();
            var order = OrderBuilder.Create()
                        .WithDepartment(department)
                        .ForMenuItem(menuItem)
                        .WithUserName(userName)
                        .WithTaxTemplates(taxTemplates)
                        .WithPortion(portion)
                        .WithPriceTag(priceTag)
                        .WithAccountTransactionType(template)
                        .WithProductTimer(timer)
                        .Build();

            AddOrder(order, taxTemplates, template, userName);
            return(order);
        }
 public OrderBuilder WithProductTimer(ProductTimer productTimer)
 {
     _productTimer = productTimer;
     return(this);
 }
示例#6
0
        public Order AddOrder(AccountTransactionType template, Department department, string userName, MenuItem menuItem, IList <TaxTemplate> taxTemplates, MenuItemPortion portion, string priceTag, ProductTimer timer)
        {
            UnLock();
            var order = new Order();

            order.UpdateMenuItem(userName, menuItem, taxTemplates, portion, priceTag, 1);
            order.AccountTransactionTypeId = template.Id;
            order.WarehouseId  = department.WarehouseId;
            order.DepartmentId = department.Id;
            TransactionDocument.AddSingletonTransaction(template.Id, template, GetTicketAccounts());

            if (taxTemplates != null)
            {
                foreach (var taxTemplate in taxTemplates)
                {
                    TransactionDocument.AddSingletonTransaction(taxTemplate.AccountTransactionType.Id,
                                                                taxTemplate.AccountTransactionType,
                                                                GetTicketAccounts());
                }
            }

            order.UpdateProductTimer(timer);
            Orders.Add(order);
            return(order);
        }
示例#7
0
        public Order AddOrder(AccountTransactionType template, string userName, MenuItem menuItem, MenuItemPortion portion, string priceTag, ProductTimer timer)
        {
            Locked = false;
            var order = new Order();

            order.UpdateMenuItem(userName, menuItem, portion, priceTag, 1);
            order.AccountTransactionTypeId = template.Id;

            TransactionDocument.AddSingletonTransaction(template.Id, template, AccountTypeId, AccountId);

            if (menuItem.TaxTemplate != null)
            {
                TransactionDocument.AddSingletonTransaction(order.TaxTempleteAccountTransactionTypeId,
                                                            menuItem.TaxTemplate.AccountTransactionType,
                                                            AccountTypeId, AccountId);
            }

            order.UpdateProductTimer(timer);
            Orders.Add(order);
            return(order);
        }