コード例 #1
0
 private void OnGroupedOrderTagSelected(GroupedOrderTagButtonViewModel obj)
 {
     if (!RemoveMode) obj.UpdateNextTag(obj.NextTag);
     var orderTagData = new OrderTagData
                            {
                                OrderTagGroup = obj.OrderTagGroup,
                                SelectedOrderTag = obj.CurrentTag,
                                Ticket = SelectedTicket
                            };
     if (RemoveMode) obj.UpdateNextTag(null);
     orderTagData.PublishEvent(RemoveMode ? EventTopicNames.OrderTagRemoved : EventTopicNames.OrderTagSelected, true);
     RemoveMode = false;
 }
コード例 #2
0
        private void OnOrderTagSelected(OrderTagButtonViewModel orderTag)
        {
            var mig = OrderTagGroups.First(propertyGroup => propertyGroup.OrderTags.Contains(orderTag)).Model;
            Debug.Assert(mig != null);

            var orderTagData = new OrderTagData
                                   {
                                       OrderTagGroup = mig,
                                       SelectedOrderTag = orderTag.Model,
                                       Ticket = SelectedTicket
                                   };

            orderTagData.PublishEvent(RemoveMode ? EventTopicNames.OrderTagRemoved : EventTopicNames.OrderTagSelected, true);
            RemoveMode = false;
            OrderTagGroups.Where(x => x.OrderTags.Contains(orderTag)).ToList().ForEach(x => x.Refresh());
        }
コード例 #3
0
        private void OnFreeTagSelected(OrderTagGroupViewModel obj)
        {
            if (string.IsNullOrEmpty(obj.FreeTagName) || string.IsNullOrEmpty(obj.FreeTagName.Trim())) return;
            if (obj.OrderTags.Any(x => x.Name.ToLower() == obj.FreeTagName.ToLower()))
            {
                var b = obj.OrderTags.First(x => x.Name == obj.FreeTagName.ToLower());
                OnOrderTagSelected(b);
                return;
            }

            var orderTagData = new OrderTagData
            {
                OrderTagGroup = obj.Model,
                SelectedOrderTag = new OrderTag { Name = obj.FreeTagName, Price = obj.FreeTagPrice },
                Ticket = SelectedTicket
            };

            obj.FreeTagName = "";
            obj.FreeTagPriceStr = "0";
            obj.CreateOrderTagButton(orderTagData);
            orderTagData.PublishEvent(RemoveMode ? EventTopicNames.OrderTagRemoved : EventTopicNames.OrderTagSelected, true);
            RemoveMode = false;
            OrderTagGroups.Where(x => x.OrderTags.Any(y => y.Name == obj.FreeTagName)).ToList().ForEach(x => x.Refresh());
        }