Example #1
0
        private void TagOrder(OrderTagGroup orderTagGroup, OrderTag orderTag, int userId, int tagIndex, string tagNote)
        {
            var otag = new OrderTagValue
            {
                TagValue                = orderTag.Name,
                OrderTagGroupId         = orderTagGroup.Id,
                TagName                 = orderTagGroup.Name,
                TagNote                 = !string.IsNullOrEmpty(tagNote) ? tagNote : null,
                MenuItemId              = orderTag.MenuItemId,
                AddTagPriceToOrderPrice = orderTagGroup.AddTagPriceToOrderPrice,
                PortionName             = orderTag.MenuItemId > 0 ? PortionName : null,
                UserId   = userId,
                Quantity = 1,
                OrderKey = orderTagGroup.SortOrder.ToString("000") + orderTag.SortOrder.ToString("000"),
                TaxFree  = orderTagGroup.TaxFree
            };

            otag.UpdatePrice(orderTag.Price);

            if (tagIndex > -1)
            {
                OrderTagValues.Insert(tagIndex, otag);
            }
            else
            {
                OrderTagValues.Add(otag);
            }
            OrderTags       = JsonHelper.Serialize(OrderTagValues);
            _orderTagValues = null;
        }
Example #2
0
 public void UntagOrder(OrderTagValue orderTagValue)
 {
     OrderTagValues.Remove(orderTagValue);
     OrderTags       = JsonHelper.Serialize(OrderTagValues);
     _orderTagValues = null;
 }