private ProductivityTime GetProductivityTimer(EmployeeActionBase employeeAction, AddTimeOptions option, ProductivityTime timer) { switch (option) { case AddTimeOptions.Continuous: var endTime = employeeAction.StartTime.Add(employeeAction.Duration); timer.Duration = endTime - timer.EndTime; timer.EndTime = endTime; break; case AddTimeOptions.Duration: timer.Duration += employeeAction.Duration; timer.EndTime = employeeAction.StartTime.Add(employeeAction.Duration); break; } return(timer); }
public void AddTime(EmployeeActionBase employeeAction, AddTimeOptions option = AddTimeOptions.Duration) { switch (employeeAction.Operation.Group) { case OperationGroups.Gathering: case OperationGroups.Packing: (( TimeIndicators )Times).GatheringTime += GetProductivityTimer(employeeAction, option, (( TimeIndicators )Times).GatheringTime); break; //case OperationGroups.ClientGathering : //case OperationGroups.ClientPacking : // (( TimeIndicators )Times).ClientGatheringTime += // GetProductivityTimer( employeeAction, option, (( TimeIndicators )Times).ClientGatheringTime ); // break; //case OperationGroups.ShopperGathering: // (( TimeIndicators )Times).ShopperGatheringTime += // GetProductivityTimer( employeeAction, option, (( TimeIndicators )Times).ShopperGatheringTime ); // break; //case OperationGroups.Scanning : // (( TimeIndicators )Times).ScanningTime += // GetProductivityTimer( employeeAction, option, (( TimeIndicators )Times).ScanningTime ); // break; //case OperationGroups.ClientScanning : // (( TimeIndicators )Times).ClientScanningTime += // GetProductivityTimer( employeeAction, option, (( TimeIndicators )Times).ClientScanningTime ); // break; case OperationGroups.Defragmentation: (( TimeIndicators )Times).DefragmentationTime += GetProductivityTimer(employeeAction, option, (( TimeIndicators )Times).DefragmentationTime); break; case OperationGroups.Placing: (( TimeIndicators )Times).PlacingTime += GetProductivityTimer(employeeAction, option, (( TimeIndicators )Times).PlacingTime); break; case OperationGroups.Inventory: (( TimeIndicators )Times).InventoryTime += GetProductivityTimer(employeeAction, option, (( TimeIndicators )Times).InventoryTime); break; case OperationGroups.Shipment: (( TimeIndicators )Times).ShipmentTime += GetProductivityTimer(employeeAction, option, (( TimeIndicators )Times).ShipmentTime); break; default: (( TimeIndicators )Times).NonProductivTime += GetProductivityTimer(employeeAction, option, (( TimeIndicators )Times).NonProductivTime); break; } }