public OrderResponse DisplaySingleOrder(Order order)
        {
            OrderResponse  response     = new OrderResponse();
            IsValidChecker validChecker = new IsValidChecker();

            response.Order = _orderRepository.LookUpIndividualOrder(order);
            if (response.Order == null)
            {
                response.Success = false;
                response.Message = "Please provide a date or order";
            }
            else
            {
                var validOrder = validChecker.ValidOrderChecker(response.Order);
                if (validOrder.IsValid == false)
                {
                    response.Success = false;
                    response.Message = "That order/date does not exsist";
                }
                else
                {
                    response.Success = true;
                }
            }
            return(response);
        }
        public OrderResponse WriteEditedOrder(Order order)
        {
            OrderResponse  respnose     = new OrderResponse();
            IsValidChecker validChecker = new IsValidChecker();
            var            validOrder   = validChecker.ValidOrderChecker(order);

            if (validOrder.IsValid == false)
            {
                respnose.Success = false;
                return(respnose);
            }
            else
            {
                if (!_orderRepository.WriteOrders(order))
                {
                    respnose.Success = false;
                    respnose.Message = "Not able to write order";
                }
                else
                {
                    respnose.Success = true;
                }
            }
            return(respnose);
        }
        public AddOrderResponse AddOrder(Order newOrder)
        {
            AddOrderResponse response   = new AddOrderResponse();
            IsValidChecker   orderCheck = new IsValidChecker();
            var validOrder = orderCheck.ValidOrderChecker(newOrder);

            if (validOrder.IsValid == false)
            {
                response.Success = false;
                response.Message = "An error has occurred";
                return(response);
            }
            else if (validOrder.IsValid == true)
            {
                if (!_orderRepository.AddOrders(validOrder))
                {
                    response.Success = false;
                    response.Message = "An error has occurred, please retry";
                }
                return(response);
            }
            return(response);
        }