示例#1
0
        public LineItemModifier(OrderLineVM lineitem, Action onDone = null)
        {
            _lineitem  = lineitem;
            _line      = lineitem._line;
            IsPopup    = true;
            EnableMask = true;
            _onDone    = onDone;
            _quantity  = _lineitem.Quantity;


            _size           = _line.vLineItemsize;
            _spice          = _line.vLineItemspice;
            _cooked         = _line.vLineItemcooked;
            _customComments = _line.vCustomComments;


            if (!string.IsNullOrEmpty(_line.vLineitemaddon))
            {
                var addonpairs = JsonConvert.DeserializeObject <Dictionary <string, decimal> >(_line.vLineitemaddon);

                foreach (var n in Addons)
                {
                    if (addonpairs.ContainsKey(n.Key))
                    {
                        n.IsSelected = true;
                        n.Value      = addonpairs[n.Key];
                    }
                }
            }
        }
示例#2
0
        public OrderLineVM(POS_ItemMaster item, OrderVM parent, POS_OrderDetails line = null)
        {
            _parent = parent;
            _item   = item;


            if (line == null)
            {
                _line = new POS_OrderDetails();
                _line.fLineItemPrice   = item.vItemPrice;
                _line.POS_ItemMasterId = _item.Id;


                Quantity++;
            }

            else
            {
                _line = line;
            }
        }