public OrderBuilderTestContext WithProductTimer() { ProductTimer = new ProductTimer { Id = 12 }; return(this); }
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, }; } }
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; } }
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); }
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); }
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); }