public void Select001(string startTime, string endTime, string person) { Result = new List <AlertPrecessLogInfo> (); string sql = "select ID,ALERTTIME,ALERTTYPE,PERSON,STARTTIME,ENDTIME,MEMO from CYGJ_ALERT_PROCESS_LOG where "; string where1 = "STARTTIME >= '" + startTime + "'"; string where2 = "ENDTIME <= '" + endTime + " 23:59:59'"; string where3 = "PERSON = '" + person + "'"; string where4 = "ALERTTIME <> " + "' '"; if (startTime.Trim() != "" || endTime.Trim() != "" || person.Trim() != "") { if (startTime.Trim() != "") { sql += where1 + " and "; } if (endTime.Trim() != "") { sql += where2 + " and "; } if (person.Trim() != "") { sql += where3 + " and "; } sql += where4 + " order by ALERTTIME asc"; } else { sql += where4 + " order by ALERTTIME desc"; } DataSet ds = OdbcDataManager.Instance.odbcOra.ReturnDataSet(sql, "CYGJ_ALERT_PROCESS_LOG"); if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { AlertPrecessLogInfo info = new AlertPrecessLogInfo(); info.id = dr["ID"].ToString(); info.alertTime = dr["ALERTTIME"].ToString(); info.alertType = dr["ALERTTYPE"].ToString(); info.person = dr["PERSON"].ToString(); info.startTime = dr["STARTTIME"].ToString(); info.endTime = dr["ENDTIME"].ToString(); info.memo = dr["MEMO"].ToString(); Result.Add(info); } } Logger.Instance.WriteLog("根据记录开始时间,结束时间,处理人,查找报警处理日志"); }
public void SetValue(string no, AlertPrecessLogInfo info) { No.text = no; AlertTime.text = info.alertTime; AlertType.text = info.alertType; Person.text = info.person; StartTime.text = info.startTime; EndTime.text = info.endTime; Memo.text = info.memo; if (int.Parse(no) % 2 == 0) { Background2.SetActive(true); } else { Background1.SetActive(true); } }