コード例 #1
0
        public List <Model.Order> GetAllActual()
        {
            try
            {
                DataAccess.Orders  orders = new DataAccess.Orders();
                List <Model.Order> result = orders.GetAllActual();

                return(ChangeTimes(result));
            }
            catch (Exception ex)
            {
                Trace.WriteError("()", Trace.GetMethodName(), CLASSNAME, ex);
                throw;
            }
        }
コード例 #2
0
        public OrderStatus StartOrder(Order orderToStart)
        {
            DataAccess.Orders  orders             = new DataAccess.Orders();
            List <Model.Order> actualOrdersResult = orders.GetAllActual();

            foreach (Model.Order actualOrder in actualOrdersResult)
            {
                if (actualOrder.StartDate != null && actualOrder.ResourceId == orderToStart.ResourceId)
                {
                    return(OrderStatus.Resource_in_use);
                }
            }

            orderToStart.StartDate = DateTime.UtcNow;
            orders.Modify(orderToStart);

            return(OrderStatus.Succes);
        }