Esempio n. 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")
            };

            otag.UpdatePrice(orderTag.Price);

            if (tagIndex > -1)
            {
                OrderTagValues.Insert(tagIndex, otag);
            }
            else
            {
                OrderTagValues.Add(otag);
            }
            OrderTags       = JsonHelper.Serialize(OrderTagValues);
            _orderTagValues = null;
        }
Esempio n. 2
0
        private void TagOrder(OrderTagGroup orderTagGroup, OrderTag orderTag, int userId, int tagIndex)
        {
            var otag = new OrderTagValue
            {
                Name                    = orderTag.Name,
                OrderTagGroupId         = orderTagGroup.Id,
                OrderTagGroupName       = orderTagGroup.Name,
                MenuItemId              = orderTag.MenuItemId,
                AddTagPriceToOrderPrice = orderTagGroup.AddTagPriceToOrderPrice,
                PortionName             = PortionName,
                SubValue                = !string.IsNullOrEmpty(orderTagGroup.ButtonHeader) && orderTag.Price == 0 && orderTagGroup.MaxSelectedItems == 1,
                UserId                  = userId,
                Quantity                = 1,
                NewTag                  = true,
                OrderKey                = orderTagGroup.Order.ToString("000") + orderTag.Order.ToString("000")
            };

            otag.UpdatePrice(TaxIncluded, TaxRate, orderTag.Price);

            if (tagIndex > -1)
            {
                OrderTagValues.Insert(tagIndex, otag);
            }
            else
            {
                OrderTagValues.Add(otag);
            }
        }
Esempio n. 3
0
 private void UntagOrder(OrderTagValue orderTagValue)
 {
     OrderTagValues.Remove(orderTagValue);
 }
Esempio n. 4
0
 private void UntagOrder(OrderTagValue orderTagValue)
 {
     OrderTagValues.Remove(orderTagValue);
 }
Esempio n. 5
0
        private void TagOrder(OrderTagGroup orderTagGroup, OrderTag orderTag, int userId, int tagIndex)
        {
            var otag = new OrderTagValue
                       {
                           Name = orderTag.Name,
                           OrderTagGroupId = orderTagGroup.Id,
                           OrderTagGroupName = orderTagGroup.Name,
                           MenuItemId = orderTag.MenuItemId,
                           AddTagPriceToOrderPrice = orderTagGroup.AddTagPriceToOrderPrice,
                           PortionName = PortionName,
                           SubValue = !string.IsNullOrEmpty(orderTagGroup.ButtonHeader) && orderTag.Price == 0 && orderTagGroup.MaxSelectedItems == 1,
                           UserId = userId,
                           Quantity = 1,
                           NewTag = true,
                           OrderKey = orderTagGroup.Order.ToString("000") + orderTag.Order.ToString("000")
                       };

            otag.UpdatePrice(TaxIncluded, TaxRate, orderTag.Price);

            if (tagIndex > -1)
                OrderTagValues.Insert(tagIndex, otag);
            else
                OrderTagValues.Add(otag);
        }
 public OrderTagValueViewModel(OrderTagValue model)
 {
     Model = model;
 }
Esempio n. 7
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")
                       };

            otag.UpdatePrice(orderTag.Price);

            if (tagIndex > -1)
                OrderTagValues.Insert(tagIndex, otag);
            else
                OrderTagValues.Add(otag);
            OrderTags = JsonHelper.Serialize(OrderTagValues);
            _orderTagValues = null;
        }
Esempio n. 8
0
 public void UntagOrder(OrderTagValue orderTagValue)
 {
     OrderTagValues.Remove(orderTagValue);
     OrderTags = JsonHelper.Serialize(OrderTagValues);
     _orderTagValues = null;
 }
Esempio n. 9
0
 public void UntagOrder(OrderTagValue orderTagValue)
 {
     OrderTagValues.Remove(orderTagValue);
     OrderTags       = JsonHelper.Serialize(OrderTagValues);
     _orderTagValues = null;
 }
Esempio n. 10
0
 private void UntagOrder(OrderTagValue orderTagValue)
 {
     OrderTagValues.Remove(orderTagValue);
     CalculatePrice = OrderTagValues.FirstOrDefault(x => !x.CalculatePrice) == null;
     DecreaseInventory = OrderTagValues.FirstOrDefault(x => !x.DecreaseInventory) == null;
     if (orderTagValue.UnlocksOrder && OrderTagValues.FirstOrDefault(x => x.UnlocksOrder && x.NewTag) == null) Locked = true;
 }
Esempio n. 11
0
        private void TagOrder(OrderTagGroup orderTagGroup, OrderTag orderTag, int userId, int tagIndex)
        {
            var otag = new OrderTagValue
                       {
                           Name = orderTag.Name,
                           OrderTagGroupId = orderTagGroup.Id,
                           MenuItemId = orderTag.MenuItemId,
                           AddTagPriceToOrderPrice = orderTagGroup.AddTagPriceToOrderPrice,
                           PortionName = PortionName,
                           UserId = userId,
                           DecreaseInventory = orderTagGroup.DecreaseOrderInventory,
                           CalculatePrice = orderTagGroup.CalculateOrderPrice,
                           Quantity = 1,
                           UnlocksOrder = orderTagGroup.UnlocksOrder,
                           NewTag = true
                       };

            otag.UpdatePrice(TaxIncluded, TaxRate, orderTag.Price);

            if (tagIndex > -1)
                OrderTagValues.Insert(tagIndex, otag);
            else
                OrderTagValues.Add(otag);

            CalculatePrice = orderTagGroup.CalculateOrderPrice;
            DecreaseInventory = orderTagGroup.DecreaseOrderInventory;
            if (orderTagGroup.UnlocksOrder) Locked = false;
        }
Esempio n. 12
0
 public OrderTagValue GetOrCreateCustomOrderTagValue()
 {
     var tip = GetCustomOrderTag();
     if (tip == null)
     {
         tip = new OrderTagValue
                   {
                       Name = "",
                       Price = 0,
                       OrderTagGroupId = 0,
                       MenuItemId = 0,
                       Quantity = 0
                   };
         OrderTagValues.Add(tip);
     }
     return tip;
 }