public static string ValidateOrderQty(WorkOrder wo, int qty)
 {
     return(qty <= 0 ? "Order Quantity must be > 0" : null);
 }
 public static DateTime DefaultStartDate(WorkOrder wo, [Injected] DateTime now)
 {
     return(now);
 }
 public static string Validate(WorkOrder wo, DateTime startDate, DateTime dueDate)
 {
     return(startDate > dueDate ? "StartDate must be before DueDate" : null);
 }
 public static (WorkOrder, WorkOrder) ChangeScrappedQuantity(this WorkOrder wo, short newQty)
 {
     return(DisplayAndPersist(wo with {
         ScrappedQty = newQty
     }));
 }
 public static WorkOrder Updating(WorkOrder wo, [Injected] DateTime now)
 {
     return(wo with {
         ModifiedDate = now
     });
 }
 /// <summary>
 /// Create a new WorkOrder object.
 /// </summary>
 /// <param name="workOrderID">Initial value of the WorkOrderID property.</param>
 /// <param name="productID">Initial value of the ProductID property.</param>
 /// <param name="orderQty">Initial value of the OrderQty property.</param>
 /// <param name="stockedQty">Initial value of the StockedQty property.</param>
 /// <param name="scrappedQty">Initial value of the ScrappedQty property.</param>
 /// <param name="startDate">Initial value of the StartDate property.</param>
 /// <param name="dueDate">Initial value of the DueDate property.</param>
 /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
 public static WorkOrder CreateWorkOrder(global::System.Int32 workOrderID, global::System.Int32 productID, global::System.Int32 orderQty, global::System.Int32 stockedQty, global::System.Int16 scrappedQty, global::System.DateTime startDate, global::System.DateTime dueDate, global::System.DateTime modifiedDate)
 {
     WorkOrder workOrder = new WorkOrder();
     workOrder.WorkOrderID = workOrderID;
     workOrder.ProductID = productID;
     workOrder.OrderQty = orderQty;
     workOrder.StockedQty = stockedQty;
     workOrder.ScrappedQty = scrappedQty;
     workOrder.StartDate = startDate;
     workOrder.DueDate = dueDate;
     workOrder.ModifiedDate = modifiedDate;
     return workOrder;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the WorkOrders EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToWorkOrders(WorkOrder workOrder)
 {
     base.AddObject("WorkOrders", workOrder);
 }