public void ParsePressure(string pn, ReadingXLSRow row) { var found = Pressures.FirstOrDefault(x => x.MathPn(pn)); if (found != null) { row.Pressure = found; row.PressureUnits = PressureUnits.PN; return; } row.Pressure = Pressures.FirstOrDefault(x => x.Pclass == pn); if (row.Pressure != null) { row.PressureUnits = PressureUnits.Pclass; } return; }
public void ParseDiameter(string dn, ReadingXLSRow row) { dn = dn.Replace("DN", "").Replace("dn", ""); int mm; if (int.TryParse(dn, out mm)) { var found = Diameters.FirstOrDefault(x => x.Mm == mm); if (found != null) { row.Diameter = found; row.DiameterUnits = DiameterUnits.mm; return; } } row.Diameter = Diameters.FirstOrDefault(x => x.Inch == dn); if (row.Diameter != null) { row.DiameterUnits = DiameterUnits.inch; } return; }