Ejemplo n.º 1
0
        //kitchen
        public async Task <OrderSumDTO> GetOrders(DateTime date)
        {
            List <OrderEntity> orders = new List <OrderEntity>();

            orders = await db.Set <OrderEntity>().Where(o => o.Date.Date == date.Date).ToListAsync();

            OrderSumDTO sum = new OrderSumDTO();

            foreach (OrderEntity order in orders)
            {
                sum.ExpectedAdults += order.Adults;
                sum.ExpectedKids   += order.Kids;
                if (order.CheckIn)
                {
                    sum.Adults += order.Adults;
                    sum.Kids   += order.Kids;
                }
                else
                {
                    sum.RemainingAdults += order.Adults;
                    sum.RemainingKids   += order.Kids;
                }
            }

            return(sum);
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> GetOrdersOnDate(DateTime date)
        {
            OrderSumDTO orders = new OrderSumDTO();

            orders = await repository.GetOrders(date.Date);

            return(View("Kitchen", orders));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Kitchen()
        {
            OrderSumDTO orders = new OrderSumDTO();

            try
            {
                orders = await repository.GetOrders(DateTime.Today);
            }
            catch
            {
            }
            return(View(orders));
        }