public static (WorkOrderRouting, WorkOrderRouting) AddNewRouting(WorkOrder wo, Location loc)
        {
            int highestSequence = wo.WorkOrderRoutings.Count > 0 ? wo.WorkOrderRoutings.Max(n => n.OperationSequence) + 1 : 1;
            var wor             = new WorkOrderRouting() with
            {
                WorkOrder         = wo,
                Location          = loc,
                OperationSequence = (short)highestSequence
            };

            return(DisplayAndPersist(wor));
        }
    }
Esempio n. 2
0
        public WorkOrderRouting AddNewRouting(Location loc)
        {
            var wor = new WorkOrderRouting();

            wor.WorkOrder = this;
            wor.Location  = loc;
            short highestSequence = 0;
            short increment       = 1;

            if (WorkOrderRoutings.Count > 0)
            {
                highestSequence = WorkOrderRoutings.Max(n => n.OperationSequence);
            }
            highestSequence      += increment;
            wor.OperationSequence = highestSequence;
            return(wor);
        }
Esempio n. 3
0
 public static string ValidatePlannedCost(this WorkOrderRouting wor, decimal plannedCost)
 {
     return(plannedCost <= 0 ? "Planned cost must be > 0" : "");
 }
Esempio n. 4
0
 public static (WorkOrderRouting, WorkOrderRouting) SetScheduledStartDate(this WorkOrderRouting wor, DateTime date, int hour, int minutes)
 => DisplayAndPersist(wor with {
 /// <summary>
 /// Create a new WorkOrderRouting object.
 /// </summary>
 /// <param name="workOrderID">Initial value of the WorkOrderID property.</param>
 /// <param name="productID">Initial value of the ProductID property.</param>
 /// <param name="operationSequence">Initial value of the OperationSequence property.</param>
 /// <param name="locationID">Initial value of the LocationID property.</param>
 /// <param name="scheduledStartDate">Initial value of the ScheduledStartDate property.</param>
 /// <param name="scheduledEndDate">Initial value of the ScheduledEndDate property.</param>
 /// <param name="plannedCost">Initial value of the PlannedCost property.</param>
 /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
 public static WorkOrderRouting CreateWorkOrderRouting(global::System.Int32 workOrderID, global::System.Int32 productID, global::System.Int16 operationSequence, global::System.Int16 locationID, global::System.DateTime scheduledStartDate, global::System.DateTime scheduledEndDate, global::System.Decimal plannedCost, global::System.DateTime modifiedDate)
 {
     WorkOrderRouting workOrderRouting = new WorkOrderRouting();
     workOrderRouting.WorkOrderID = workOrderID;
     workOrderRouting.ProductID = productID;
     workOrderRouting.OperationSequence = operationSequence;
     workOrderRouting.LocationID = locationID;
     workOrderRouting.ScheduledStartDate = scheduledStartDate;
     workOrderRouting.ScheduledEndDate = scheduledEndDate;
     workOrderRouting.PlannedCost = plannedCost;
     workOrderRouting.ModifiedDate = modifiedDate;
     return workOrderRouting;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the WorkOrderRoutings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToWorkOrderRoutings(WorkOrderRouting workOrderRouting)
 {
     base.AddObject("WorkOrderRoutings", workOrderRouting);
 }