public Order RegisterNewOrder(int _customerID)
        {
            int newOrderID = Orderctx.RegisterNewOrder(_customerID);
            IOrderStatusRepository OrderStatusRepo = new OrderStatusRepository();
            Order result = DataRowToOrder(Orderctx.GetOrderByID(newOrderID));

            result.AddOrderStatus(OrderStatusRepo.GenerateOrderStatus(newOrderID, OrderStatus.OrderStatusesEnum.Ordering));
            return(result);
        }
        private Order DataRowToOrder(DataRow _dataRow)
        {
            int OrderID = Convert.ToInt16(_dataRow.Field <decimal>("ID"));
            IOrderLineRepository   OrderLineRepo   = new OrderLineRepository();
            IOrderStatusRepository OrderStatusRepo = new OrderStatusRepository();
            IUserRepository        UserRepo        = new UserRepository();
            Order result = new Order(OrderID, UserRepo.GetUserByID(Convert.ToInt16(_dataRow.Field <Decimal>("CustomerID"))));

            foreach (OrderLine OL in OrderLineRepo.GetAllOrderLinesForOrder(OrderID))
            {
                result.AddOrderLine(OL);
            }
            foreach (OrderStatus OS in OrderStatusRepo.GetOrderStatusesForOrder(OrderID))
            {
                result.AddOrderStatus(OS);
            }
            return(result);
        }