コード例 #1
0
        public IHttpActionResult RemoveItemWithSetPriceForQtyWithLimit(int id, double weight, int requiredQty, double setPrice, int limit)
        {
            var lineItem = items.FirstOrDefault((p) => p.Id == id);

            if (lineItem == null)
            {
                return(NotFound());
            }
            Scanned scanned = new Scanned();

            scanned.Remove(lineItem, weight, requiredQty, setPrice, limit, true);
            Receipt.Sum();
            return(Ok(Receipt.OrderTotal));
        }
コード例 #2
0
        public IHttpActionResult RemoveItemBuyNGetMAtXWithLimit(int id, double weight, int requiredQty, double percentOff, int discountedQty, int limit)
        {
            var lineItem = items.FirstOrDefault((p) => p.Id == id);

            if (lineItem == null)
            {
                return(NotFound());
            }

            Scanned scanned = new Scanned();

            scanned.Remove(lineItem, weight, requiredQty, percentOff, discountedQty, limit);
            Receipt.Sum();
            return(Ok(Receipt.OrderTotal));
        }
コード例 #3
0
        // Remove simple item
        public IHttpActionResult RemoveItem(int id)
        {
            var lineItem = items.FirstOrDefault((p) => p.Id == id);

            if (lineItem == null)
            {
                return(NotFound());
            }

            Scanned scanned = new Scanned();

            scanned.Remove(lineItem);
            Receipt.Sum();
            return(Ok(Receipt.OrderTotal));
        }
コード例 #4
0
        // Marked-down
        public IHttpActionResult RemoveItemWithMarkdown(int id, double weight, double markdown)
        {
            var lineItem = items.FirstOrDefault((p) => p.Id == id);

            if (lineItem == null)
            {
                return(NotFound());
            }

            if (lineItem.Eaches)
            {
                weight = 1.00;
            }
            Scanned scanned = new Scanned();

            scanned.Remove(lineItem, weight, markdown);
            Receipt.Sum();
            return(Ok(Receipt.OrderTotal));
        }