当前位置: 首页>>代码示例>>C#>>正文


C# Tickets.Ticket类代码示例

本文整理汇总了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);
 }
开发者ID:shuxingliu,项目名称:SambaPOS-3,代码行数:7,代码来源:TicketTagListViewModel.cs

示例2: UpdateTicket

 public void UpdateTicket(Ticket ticket)
 {
     Model.UpdateTicket(ticket);
     Selectors.Clear();
     Selectors.AddRange(Model.Selectors.Select(x => new SelectorViewModel(x)));
     Refresh();
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:7,代码来源:OrderSelectorViewModel.cs

示例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;
        }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:25,代码来源:Helper.cs

示例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;
        }
开发者ID:basio,项目名称:SambaPOS-3,代码行数:25,代码来源:TicketService.cs

示例5: CanUpdatesTicketCorrectly

 public void CanUpdatesTicketCorrectly()
 {
     var ticket = new Ticket();
     var orderSelector = new OrderSelector();
     orderSelector.UpdateTicket(ticket);
     Assert.AreEqual(ticket, orderSelector.SelectedTicket);
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:7,代码来源:PaymentOrderSelectorTests.cs

示例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);
            }
        }
开发者ID:betology,项目名称:SambaPOS-3,代码行数:30,代码来源:TicketViewModel.cs

示例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);
 }
开发者ID:roniwahyu,项目名称:SambaPOS-3,代码行数:7,代码来源:AutomationCommandData.cs

示例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;
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:25,代码来源:TicketPrintTaskBuilder.cs

示例9: TicketTotalsViewModel

 public TicketTotalsViewModel(ICacheService cacheService, AccountBalances accountBalances)
 {
     _cacheService = cacheService;
     _accountBalances = accountBalances;
     ResetCache();
     _model = Ticket.Empty;
 }
开发者ID:khriza,项目名称:SambaPOS-3,代码行数:7,代码来源:TicketTotalsViewModel.cs

示例10: Reset

 public void Reset()
 {
     Debug.Assert(Ticket != null);
     Debug.Assert(_workspace != null);
     Ticket = null;
     _workspace = null;
 }
开发者ID:hpbaotho,项目名称:sambapos,代码行数:7,代码来源:MainDataContext.cs

示例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);
     }
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:8,代码来源:TicketPrinter.cs

示例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);
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:8,代码来源:ExpressionTests.cs

示例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);
     }
 }
开发者ID:hperassi,项目名称:SambaPOS-3,代码行数:8,代码来源:TicketService.cs

示例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);
     }
 }
开发者ID:basio,项目名称:veropos,代码行数:8,代码来源:TicketPrinter.cs

示例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);
 }
开发者ID:neapolis,项目名称:SambaPOS-3,代码行数:9,代码来源:TicketResourceListViewModel.cs


注:本文中的Samba.Domain.Models.Tickets.Ticket类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。