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; } }
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); }