/// <summary> /// 查找老化前测试是否是第二次测试 /// </summary> /// <param name="FuselageCode"></param> /// <param name="SQLCommand"></param> /// <returns></returns> public ProjectorInformation_LHQ selectProjectorInformation_MainTable_LHQDal(string FuselageCode, string SQLCommand) { string sql = SQLhelp.GetSQLCommand(SQLCommand); ProjectorInformation_LHQ pif = new ProjectorInformation_LHQ(); DateTime dt = new DateTime(1993, 5, 17); SqlParameter[] pms = new SqlParameter[] { new SqlParameter("@FuselageCode", SqlDbType.VarChar, 80) { Value = FuselageCode } }; using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text, pms)) { if (reader.HasRows) { while (reader.Read()) { pif.FuselageCode = reader.GetString(0); pif.PreAgingTestTime = reader.IsDBNull(1) ? dt : reader.GetDateTime(1); pif.PreAgingTestTime2 = reader.IsDBNull(2) ? null : reader.GetDateTime(2).ToString(); } } return(pif); } }
/// <summary> /// 老化前测试,如果主表没有该机身码,则插入 /// </summary> /// <param name="proje"></param> /// <param name="SQLCommand"></param> /// <returns></returns> public bool insertProjectorInformation_MainTable_LHQBll(ProjectorInformation_LHQ proje, string SQLCommand) { if (pmtd.insertProjectorInformation_MainTable_LHQDal(proje, SQLCommand) > 0) { return(true); } else { return(false); } }
/// <summary> /// 老化前测试,如果主表没有该机身码,则插入 /// </summary> /// <param name="proje"></param> /// <param name="SQLCommand"></param> /// <returns></returns> public int insertProjectorInformation_MainTable_LHQDal(ProjectorInformation_LHQ proje, string SQLCommand) { string sql = SQLhelp.GetSQLCommand(SQLCommand); SqlParameter[] pms = new SqlParameter[] { new SqlParameter("@FuselageCode", SqlDbType.VarChar, 80) { Value = proje.FuselageCode }, new SqlParameter("@PreAgingTestTime", SqlDbType.DateTime) { Value = proje.PreAgingTestTime } }; return(SQLhelp.ExecuteNonQuery(sql, CommandType.Text, pms)); }