本文整理汇总了C#中Samba.Domain.Models.Tickets.Ticket类的典型用法代码示例。如果您正苦于以下问题:C# Ticket类的具体用法?C# Ticket怎么用?C# Ticket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Ticket类属于Samba.Domain.Models.Tickets命名空间,在下文中一共展示了Ticket类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
public void Update(Ticket selectedTicket)
{
_selectedTicket = selectedTicket;
TicketTagValueViewModels.Clear();
TicketTagValueViewModels.AddRange(_applicationState.GetTicketTagGroups().Where(x => x.AskBeforeCreatingTicket).Select(x => new TicketTagValueViewModel(x, selectedTicket)));
RaisePropertyChanged(() => RowCount);
}
示例2: UpdateTicket
public void UpdateTicket(Ticket ticket)
{
Model.UpdateTicket(ticket);
Selectors.Clear();
Selectors.AddRange(Model.Selectors.Select(x => new SelectorViewModel(x)));
Refresh();
}
示例3: GetOrders
public static IList<Order> GetOrders(ActionData x, Ticket ticket)
{
IList<Order> orders = new List<Order>();
var selectedOrder = x.GetDataValue<Order>("Order");
if (selectedOrder != null && ticket != null && selectedOrder.SelectedQuantity > 0 &&
selectedOrder.SelectedQuantity != selectedOrder.Quantity)
{
selectedOrder = ticket.ExtractSelectedOrder(selectedOrder);
x.DataObject.Order = selectedOrder;
}
if (selectedOrder == null)
{
if (ticket != null)
{
orders = ticket.Orders.Any(y => y.IsSelected)
? ticket.ExtractSelectedOrders().ToList()
: ticket.Orders;
x.DataObject.Order = null;
}
}
else orders.Add(selectedOrder);
return orders;
}
示例4: AddOrder
public Order AddOrder(Ticket ticket, int menuItemId, decimal quantity, string portionName, OrderTagTemplate template)
{
if (ticket.IsLocked && !_userService.IsUserPermittedFor(PermissionNames.AddItemsToLockedTickets)) return null;
if (!ticket.CanSubmit) return null;
var menuItem = _cacheService.GetMenuItem(x => x.Id == menuItemId);
var portion = _cacheService.GetMenuItemPortion(menuItemId, portionName);
if (portion == null) return null;
var priceTag = _applicationState.CurrentDepartment.PriceTag;
var productTimer = _applicationState.GetProductTimer(menuItemId);
var order = ticket.AddOrder(
_applicationState.CurrentTicketType.SaleTransactionType,
_applicationState.CurrentDepartment.Model,
_applicationState.CurrentLoggedInUser.Name, menuItem,
_applicationState.GetTaxTemplates(menuItem.Id).ToList(), portion, priceTag, productTimer);
order.Quantity = quantity > 9 ? decimal.Round(quantity / portion.Multiplier, 3, MidpointRounding.AwayFromZero) : quantity;
if (template != null) template.OrderTagTemplateValues.ToList().ForEach(x => order.ToggleOrderTag(x.OrderTagGroup, x.OrderTag, 0, ""));
RecalculateTicket(ticket);
order.PublishEvent(EventTopicNames.OrderAdded);
_automationService.NotifyEvent(RuleEventNames.OrderAdded, new { Ticket = ticket, Order = order, order.MenuItemName });
return order;
}
示例5: CanUpdatesTicketCorrectly
public void CanUpdatesTicketCorrectly()
{
var ticket = new Ticket();
var orderSelector = new OrderSelector();
orderSelector.UpdateTicket(ticket);
Assert.AreEqual(ticket, orderSelector.SelectedTicket);
}
示例6: TicketViewModel
public TicketViewModel(Ticket model, TicketTemplate ticketTemplate, bool forcePayment,
ITicketService ticketService, IAutomationService automationService,
IApplicationState applicationState)
{
_ticketService = ticketService;
_forcePayment = forcePayment;
_model = model;
_ticketTemplate = ticketTemplate;
_automationService = automationService;
_applicationState = applicationState;
_orders = new ObservableCollection<OrderViewModel>(model.Orders.Select(x => new OrderViewModel(x, ticketTemplate, _automationService)).OrderBy(x => x.Model.CreatedDateTime));
_itemsViewSource = new CollectionViewSource { Source = _orders };
_itemsViewSource.GroupDescriptions.Add(new PropertyGroupDescription("GroupObject"));
SelectAllItemsCommand = new CaptionCommand<string>("", OnSelectAllItemsExecute);
PrintJobButtons = _applicationState.CurrentTerminal.PrintJobs
.Where(x => (!string.IsNullOrEmpty(x.ButtonHeader))
&& (x.PrinterMaps.Count(y => y.DepartmentId == 0 || y.DepartmentId == model.DepartmentId) > 0))
.OrderBy(x => x.Order)
.Select(x => new PrintJobButton(x, Model));
if (PrintJobButtons.Count(x => x.Model.UseForPaidTickets) > 0)
{
PrintJobButtons = IsPaid
? PrintJobButtons.Where(x => x.Model.UseForPaidTickets)
: PrintJobButtons.Where(x => !x.Model.UseForPaidTickets);
}
}
示例7: CanDisplay
public bool CanDisplay(Ticket selectedTicket)
{
if (string.IsNullOrEmpty(VisibleStates)) return false;
if (VisibleStates == "*") return true;
if (DisplayOnOrders) return selectedTicket.Orders.Where(x => x.IsSelected).All(x => IsInState(x, VisibleStates));
return IsInState(selectedTicket, VisibleStates);
}
示例8: GetOrders
private IEnumerable<Order> GetOrders(PrintJob printJob, Ticket ticket, Func<Order, bool> orderSelector)
{
if (printJob.ExcludeTax)
ticket.TaxIncluded = false;
IEnumerable<Order> ti;
switch (printJob.WhatToPrint)
{
case (int)WhatToPrintTypes.LastLinesByPrinterLineCount:
ti = GetLastOrders(ticket, printJob, orderSelector);
break;
case (int)WhatToPrintTypes.LastPaidOrders:
ti = GetLastPaidOrders(ticket);
break;
case (int)WhatToPrintTypes.OrdersByQuanity:
ti = SeparateOrders(ticket, orderSelector).OrderBy(x => x.MenuItemName);
break;
case (int)WhatToPrintTypes.SeparatedByQuantity:
ti = SeparateOrders(ticket, orderSelector).OrderBy(x => x.MenuItemName);
break;
default:
ti = ticket.Orders.Where(orderSelector).OrderBy(x => x.Id).ToList();
break;
}
return ti;
}
示例9: TicketTotalsViewModel
public TicketTotalsViewModel(ICacheService cacheService, AccountBalances accountBalances)
{
_cacheService = cacheService;
_accountBalances = accountBalances;
ResetCache();
_model = Ticket.Empty;
}
示例10: Reset
public void Reset()
{
Debug.Assert(Ticket != null);
Debug.Assert(_workspace != null);
Ticket = null;
_workspace = null;
}
示例11: InternalPrint
private void InternalPrint(Ticket ticket, PrintJob printJob, Func<Order, bool> orderSelector)
{
var tasks = _ticketPrintTaskBuilder.GetPrintTasksForTicket(ticket, printJob, orderSelector);
foreach (var ticketPrintTask in tasks.Where(x => x != null && x.Printer != null && x.Lines != null))
{
PrintJobFactory.CreatePrintJob(ticketPrintTask.Printer, _printerService).DoPrint(ticketPrintTask.Lines);
}
}
示例12: CanUpdateExchangeRate
public void CanUpdateExchangeRate()
{
var ticket = new Ticket(1);
ExpressionService.Eval("Ticket.Model.ExchangeRate=1.15", (new { Ticket = ticket }).ToDynamic(), 0);
Assert.AreEqual(1.15m, ticket.ExchangeRate);
var result = ExpressionService.Eval("result = Ticket.Model.ExchangeRate", (new { Ticket = ticket }).ToDynamic(), 0m);
Assert.AreEqual(1.15m, result);
}
示例13: AddAccountTransaction
public void AddAccountTransaction(Ticket ticket, Account sourceAccount, Account targetAccount, decimal amount, decimal exchangeRate)
{
var transactionType = _cacheService.FindAccountTransactionType(sourceAccount.AccountTypeId, targetAccount.AccountTypeId, sourceAccount.Id, targetAccount.Id);
if (transactionType != null)
{
ticket.TransactionDocument.AddNewTransaction(transactionType, ticket.GetTicketAccounts(), amount, exchangeRate);
}
}
示例14: AutoPrintTicket
public static void AutoPrintTicket(Ticket ticket)
{
foreach (var customPrinter in AppServices.CurrentTerminal.PrintJobs.Where(x => !x.UseForPaidTickets))
{
if (ShouldAutoPrint(ticket, customPrinter))
ManualPrintTicket(ticket, customPrinter);
}
}
示例15: Update
public void Update(Ticket selectedTicket)
{
ResourceList.Clear();
var rt = _cacheService.GetTicketTypeById(selectedTicket.TicketTypeId).ResourceTypeAssignments.First(
x => x.AskBeforeCreatingTicket && !selectedTicket.TicketResources.Any(y => y.ResourceTypeId == x.ResourceTypeId));
ResourceList.AddRange(_cacheService.GetResources(rt.ResourceTypeId, rt.State));
RaisePropertyChanged(() => RowCount);
RaisePropertyChanged(() => ColumnCount);
}