public HeatCommon GetHeatInfo(HeatCommon heat) { var sql = string.Format("SELECT HEAT_ID, HEAT_NO, SHP_NO, HEAT_DTB, HEAT_DTE FROM SHP.SHP_HEATS WHERE HEAT_NO = {0} ", heat.HeatNumber); var reader = Execute(sql); if (reader.Read()) { heat.HeatId = int.Parse(CheckNubmerForNull(reader[0].ToString())); heat.ShpNumber = int.Parse(CheckNubmerForNull(reader[2].ToString())); heat.HeatStartDB = DateTime.Parse(CheckDateForNull(reader[3].ToString())); heat.HeatEndtDB = DateTime.Parse(CheckDateForNull(reader[4].ToString())); } reader.Close(); return GetPreviousHeatInfo(heat); }
private HeatCommon GetPreviousHeatInfo(HeatCommon heat) { var sql = string.Format("SELECT MIN(Time) AS MinTime, MAX(Time) AS MaxTime, HeatNumber " + "FROM EVENTS.HEATPASSPORTEVENT2 WHERE HeatNumber = " + "(SELECT HeatNumber FROM EVENTS.HEATPASSPORTEVENT2 WHERE TIME = {0}) " + "GROUP BY HeatNumber ", OracleDate(heat.PrecedingHeatEnd)); var reader = Execute(sql); if (reader.Read()) { heat.PreviousHeatStart = DateTime.Parse(CheckDateForNull(reader[0].ToString())); heat.PreviousHeatEnd = DateTime.Parse(CheckDateForNull(reader[1].ToString())); heat.PreviousHeatNumber = int.Parse(CheckNubmerForNull(reader[2].ToString())); } reader.Close(); return heat; }