public static List <String> GetFilsNameListWithWarningId(string warningId) { string sqlStr = "SELECT " + WarningImgDbConstNames.IMG_FILENAME + " FROM " + WarningImgDbConstNames.TABLE_NAME; sqlStr += " WHERE " + WarningImgDbConstNames.WARNING_ID + " LIKE '%" + warningId + "%'"; var strList = new List <String>(); ManageDataBase db = new ManageDataBase(DATABASE_TYPE.WarningManagementDB); SqlDataReader sdr = db.GetDataReader(sqlStr); while (sdr.Read()) { strList.Add(sdr.GetValue(0).ToString()); } sdr.Close(); return(strList); }
public static bool IsRepeatWithWarningIdAndFileName(string warningId, string fileName) { string sqlStr = "SELECT " + WarningImgDbConstNames.IMG_FILENAME + " FROM " + WarningImgDbConstNames.TABLE_NAME; sqlStr += " WHERE " + WarningImgDbConstNames.WARNING_ID + " LIKE '%" + warningId + "%'"; sqlStr += " AND " + WarningImgDbConstNames.IMG_FILENAME + "='" + fileName + "'"; ManageDataBase db = new ManageDataBase(DATABASE_TYPE.WarningManagementDB); SqlDataReader sdr = db.GetDataReader(sqlStr); while (sdr.Read()) { return(true); } return(false); }
public static byte[] GetImageWithWarningIdAndFileName(string warningId, string fileName) { string sqlStr = "SELECT " + WarningImgDbConstNames.IMG + " FROM " + WarningImgDbConstNames.TABLE_NAME; sqlStr += " WHERE " + WarningImgDbConstNames.WARNING_ID + " LIKE '%" + warningId + "%'"; sqlStr += " AND " + WarningImgDbConstNames.IMG_FILENAME + "='" + fileName + "'"; byte[] result = new byte[] { }; ManageDataBase db = new ManageDataBase(DATABASE_TYPE.WarningManagementDB); SqlDataReader sdr = db.GetDataReader(sqlStr); while (sdr.Read()) { result = (byte[])sdr.GetValue(0); } return(result); }