本文整理汇总了C#中Samba.Domain.Models.Tickets.Order类的典型用法代码示例。如果您正苦于以下问题:C# Order类的具体用法?C# Order怎么用?C# Order使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Order类属于Samba.Domain.Models.Tickets命名空间,在下文中一共展示了Order类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GroupedOrderTagViewModel
public GroupedOrderTagViewModel(Order selectedItem, IGrouping<string, OrderTagGroup> orderTagGroups)
{
Name = orderTagGroups.Key;
OrderTags = orderTagGroups.Select(x => new GroupedOrderTagButtonViewModel(selectedItem, x)).ToList();
ColumnCount = orderTagGroups.First().ColumnCount;
ButtonHeight = orderTagGroups.First().ButtonHeight;
}
示例2: OrderViewModel
public OrderViewModel(Order model)
{
_model = model;
ResetSelectedQuantity();
ItemSelectedCommand = new DelegateCommand<OrderViewModel>(OnItemSelected);
UpdateItemColor();
}
示例3: OrderViewModel
public OrderViewModel(Order model, IAutomationService automationService)
{
_model = model;
_automationService = automationService;
ResetSelectedQuantity();
ItemSelectedCommand = new DelegateCommand<OrderViewModel>(OnItemSelected);
UpdateItemColor();
}
示例4: OrderStatesEqual
private static bool OrderStatesEqual(Order order1, Order order2)
{
var order1OrderStateValues = order1.GetOrderStateValues().ToList();
var order2OrderStateValues = order2.GetOrderStateValues().ToList();
if (!order1OrderStateValues.Any() && !order2OrderStateValues.Any()) return true;
if (order1OrderStateValues.Count() != order2OrderStateValues.Count()) return false;
return order1OrderStateValues.All(ps => order2OrderStateValues.Any(cs => cs.Equals(ps)));
}
示例5: OrderViewModel
public OrderViewModel(Order model, TicketTemplate ticketTemplate, IAutomationService ruleService)
{
_model = model;
_ticketTemplate = ticketTemplate;
_automationService = ruleService;
ResetSelectedQuantity();
ItemSelectedCommand = new DelegateCommand<OrderViewModel>(OnItemSelected);
UpdateItemColor();
}
示例6: GetPrice
private static decimal GetPrice(Order order, decimal serviceAmount, decimal sum, decimal exchangeRate, bool taxIncluded)
{
var result = order.GetPrice();
var tax = taxIncluded ? 0 : order.GetTaxAmount(false, sum, serviceAmount);
if (serviceAmount != 0 && sum != 0) result += (result * serviceAmount) / sum;
result += tax;
result = result / exchangeRate;
return result;
}
示例7: OrderViewModel
public OrderViewModel(Order model, ICacheService cacheService, IApplicationState applicationState)
{
_model = model;
_cacheService = cacheService;
_applicationState = applicationState;
ResetSelectedQuantity();
ItemSelectedCommand = new DelegateCommand<OrderViewModel>(OnItemSelected);
UpdateItemColor();
}
示例8: Update
public void Update(Order order)
{
StopTimer = false;
SelectedOrder = order;
RaisePropertyChanged(() => Start);
RaisePropertyChanged(() => End);
RaisePropertyChanged(() => Duration);
RaisePropertyChanged(() => Price);
RaisePropertyChanged(() => Value);
}
示例9: UpdateSelector
private void UpdateSelector(Order order, decimal serviceAmount, decimal sum, bool taxIncluded)
{
var selector = Selectors.FirstOrDefault(x => x.Key == GetKey(order));
if (selector == null)
{
selector = new Selector { Key = GetKey(order), Description = order.MenuItemName + order.GetPortionDesc() };
Selectors.Add(selector);
}
selector.Quantity += order.Quantity;
selector.Price = GetPrice(order, serviceAmount, sum, ExchangeRate, taxIncluded);
}
示例10: CanMergeOrders
public static bool CanMergeOrders(Order order1, Order order2)
{
if (order1.Quantity != order2.Quantity) return false;
if (order1.Price != order2.Price) return false;
if (order1.MenuItemId != order2.MenuItemId) return false;
if (order1.PortionName != order2.PortionName) return false;
if (order1.CalculatePrice != order2.CalculatePrice) return false;
if (order1.IncreaseInventory != order2.IncreaseInventory) return false;
if (order1.DecreaseInventory != order2.DecreaseInventory) return false;
if (order1.OrderTagValues.Count > 0 || order2.OrderTagValues.Count > 0) return false;
if (!OrderStatesEqual(order1, order2)) return false;
return true;
}
示例11: CalculateOrderTotal
public static decimal CalculateOrderTotal(Ticket ticket, Order order)
{
var discount = ticket.GetPreTaxServicesTotal();
if (discount != 0)
{
var tsum = ticket.GetPlainSum();
var rate = tsum > 0 ? (discount * 100) / tsum : 100;
var tiTotal = order.GetTotal();
var itemDiscount = (tiTotal * rate) / 100;
return tiTotal + itemDiscount;
}
return order.GetTotal();
}
示例12: ExecuteAutomationCommand
private void ExecuteAutomationCommand(Ticket selectedTicket, Order order, string automationCommand, string automationCommandValue)
{
if (string.IsNullOrEmpty(automationCommand)) return;
if (string.IsNullOrEmpty(automationCommandValue))
{
var ac = _cacheService.GetAutomationCommandByName(automationCommand);
if (ac != null)
{
if (!string.IsNullOrEmpty(ac.Values))
{
ac.PublishEvent(EventTopicNames.SelectAutomationCommandValue);
return;
}
}
}
_applicationState.NotifyEvent(RuleEventNames.AutomationCommandExecuted, new
{
Ticket = selectedTicket,
Order = order,
AutomationCommandName = automationCommand,
Value = automationCommandValue ?? ""
});
}
示例13: Add
private OrderViewModel Add(Order ti)
{
var result = new OrderViewModel(ti);
Orders.Add(result);
return result;
}
示例14: RemoveOrder
public void RemoveOrder(Order order)
{
var transactionId = order.AccountTransactionTypeId;
Orders.Remove(order);
if (Orders.All(x => x.AccountTransactionTypeId != transactionId))
{
TransactionDocument.AccountTransactions.Where(x => x.AccountTransactionTypeId == transactionId)
.ToList().ForEach(x => TransactionDocument.AccountTransactions.Remove(x));
}
}
示例15: CloneOrder
public Order CloneOrder(Order item)
{
Debug.Assert(_orders.Contains(item));
var result = ObjectCloner.Clone(item);
result.CreatedDateTime = DateTime.Now;
result.Quantity = 0;
_orders.Add(result);
return result;
}