public IHttpActionResult GetOrderByEmployeeId(int emplId)
        {
            var order = _db.Orders.Where(x => x.Seller == emplId);

            var res = OrderDto.ConvertToDto(order);

            return(Ok(res));
        }
        public IHttpActionResult GetOrder(int id)
        {
            var order = _db.Orders.Find(id);

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

            var res = OrderDto.ConvertToDto(order);

            return(Ok(res));
        }
        public IHttpActionResult Search([FromBody] JObject json)
        {
            dynamic data = json;

            string   searchFor = data.searchFor;
            DateTime?from      = data.from != null ? data.from : null;
            DateTime?to        = data.to != null ? data.to : null;

            if (!string.IsNullOrEmpty(searchFor))
            {
                var res = SearchSpecificDate(searchFor);
                return(Ok(OrderDto.ConvertToDto(res)));
            }
            if (@from != null && to != null)
            {
                var resDateRange = _db.Orders.Where(x => x.OrderDate > @from && x.OrderDate < to);

                return(Ok(OrderDto.ConvertToDto(resDateRange)));
            }

            var results = OrderDto.ConvertToDto(_db.Orders);

            return(Ok(results));
        }
        // GET: api/Orders
        public IEnumerable <OrderDto> GetOrders()
        {
            var res = OrderDto.ConvertToDto(_db.Orders);

            return(res);
        }