/// <summary> /// This method finds and returns the Cylinder SN that should be /// shown on a calibration or bump report. If the cylinder is /// iGas, the report should show factory ID. Otherwise it should /// show the ManualSN. /// </summary> /// <returns></returns> public string GetCylinderSNForReport() { // First determine what kind of cylinder usage // we will look for CylinderUsage targetUsage; if (this._type == GasResponseType.Bump) { targetUsage = CylinderUsage.Bump; } else if (this._type == GasResponseType.Calibrate) { targetUsage = CylinderUsage.Calibration; } else { // Don't know what type of gas operation this is return(String.Empty); } // Now loop through the CylindersUsed for this // operation, and return either the factoryID or // the manual Sn, depending on which we have. // Start at the end and go backwards since contents // of arraylist is sorted oldest to most recent. for (int i = UsedGasEndPoints.Count - 1; i >= 0; i--) { UsedGasEndPoint used = (UsedGasEndPoint)UsedGasEndPoints[i]; if (used.Usage == targetUsage) { // Commented out because with Viper, ALL cylinders are iGas cylinders; // there is no concept of "manual" cylinders. //if ( used.Cylinder.FactoryId == string.Empty ) //{ // return used.Cylinder.ManualSerialNumber; //} //else { return(used.Cylinder.FactoryId); } } } return(string.Empty); }
/// <summary> /// Returns the expiration date of the cylinder used for the /// gas operation, or datetime.min if not found. /// </summary> /// <returns></returns> public DateTime GetCylinderExpForReport() { // First determine what kind of cylinder usage // we will look for CylinderUsage targetUsage; if (this._type == GasResponseType.Bump) { targetUsage = CylinderUsage.Bump; } else if (this._type == GasResponseType.Calibrate) { targetUsage = CylinderUsage.Calibration; } else { // Don't know what type of gas operation this is return(DateTime.MinValue); } // Now loop through the CylindersUsed for this // operation, and return either the factoryID or // the manual Sn, depending on which we have. // Start at the end and go backwards since contents // of arraylist is sorted oldest to most recent. for (int i = UsedGasEndPoints.Count - 1; i >= 0; i--) { UsedGasEndPoint used = (UsedGasEndPoint)UsedGasEndPoints[i]; if (used.Usage == targetUsage) { return(used.Cylinder.ExpirationDate); } } return(DateTime.MinValue); }