private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { using (SinoSZClientBase.CommonService.CommonServiceClient _csc = new SinoSZClientBase.CommonService.CommonServiceClient()) { CurrentTaskInfo = _csc.GetTaskInfo(this.TaskID); DataTable _dt = _csc.GetTaskLog(this.TaskID, this.LastLogTime, this.CB_LOG_ALL.Checked, this.CK_LOG_ERROR.Checked); e.Result = _dt; } }
public SinoTaskInfo GetTaskInfo(string TaskID) { SinoTaskInfo _ret = null; OracleParameter[] _param = { new OracleParameter(":RWID", OracleDbType.Decimal) }; _param[0].Value = decimal.Parse(TaskID); try { OracleDataReader _dr = OracleHelper.ExecuteReader(OracleHelper.ConnectionStringProfile, CommandType.Text, SQL_GetTaskInfo, _param); while (_dr.Read()) { _ret = new SinoTaskInfo(); _ret.RWID = _dr.IsDBNull(0) ? "" : _dr.GetDecimal(0).ToString(); _ret.RWMC = _dr.IsDBNull(1) ? "" : _dr.GetString(1); _ret.RWMS = _dr.IsDBNull(2) ? "" : _dr.GetString(2); _ret.RWLX = _dr.IsDBNull(3) ? "" : _dr.GetString(3); _ret.RWML = _dr.IsDBNull(4) ? "" : _dr.GetString(4); _ret.NextTime = _dr.IsDBNull(5) ? new DateTime(1900, 1, 1) : _dr.GetDateTime(5); _ret.LastTime = _dr.IsDBNull(6) ? new DateTime(1900, 1, 1) : _dr.GetDateTime(6); _ret.RunFlag = _dr.IsDBNull(7) ? "" : _dr.GetDecimal(7).ToString(); _ret.LastResult = _dr.IsDBNull(8) ? "" : _dr.GetString(8); _ret.RWZT = _dr.IsDBNull(9) ? "" : _dr.GetDecimal(9).ToString(); } return(_ret); } catch (Exception ex) { string _errmsg = string.Format("取RWID={1}的工作任务信息时出错,错误信息为:{0}!", ex.Message, TaskID); OralceLogWriter.WriteSystemLog(_errmsg, "ERROR"); return(null); } }