Ejemplo n.º 1
0
        public int Edit([FromBody] JObject postData)
        {
            List <GuestCheckProduct> products           = postData["GuestCheckProducts"].ToObject <List <GuestCheckProduct> >();
            List <GuestCheckProduct> guestCheckProducts = new List <GuestCheckProduct>();

            GuestCheck guestCheck = postData["GuestCheck"].ToObject <GuestCheck>();

            int id = obj.UpdateGuestCheck(guestCheck);

            if (id > 0)
            {
                foreach (GuestCheckProduct elem in products)
                {
                    guestCheckProducts.Add(new GuestCheckProduct()
                    {
                        GuestCheckID = id,
                        ProductID    = elem.ProductID,
                        ProductQty   = elem.ProductQty
                    });
                }

                return(objProduct.UpdateGuestCheckProduct(guestCheckProducts));
            }

            return(0);
        }
Ejemplo n.º 2
0
        public List <Object> Details(int id)
        {
            List <Object> result = new List <Object>();

            GuestCheck guestCheck = obj.GetGuestCheckData(id);

            result.Add(guestCheck);

            List <GuestCheckProduct> guestCheckProducts = objProduct.GetGuestCheckProducts(id);

            result.Add(guestCheckProducts);

            return(result);
        }