/// <summary> /// 新的任务 /// </summary> /// <param name="t">任务类</param> public void InsertTask(Tasks t) { try { string sql = @"insert into qm_task (idx, taskname, tasksendby, taskcron, taskfile, taskparm, taskcreatetime, taskstate, taskremark, taskdbcon, taskclstype, tasktype) values (:idx, :taskname, :tasksendby, :taskcron, :taskfile, :taskparm, :taskcreatetime, :taskstate, :taskremark, :taskdbcon, :taskclstype, :tasktype)"; OracleParameter[] param = new OracleParameter[] { new OracleParameter(":idx", t.idx), new OracleParameter(":taskname", t.taskName), new OracleParameter(":tasksendby", t.taskSendby), new OracleParameter(":taskcron", t.taskCron), new OracleParameter(":taskfile", t.taskFile), new OracleParameter(":taskparm", t.taskParm), new OracleParameter(":taskcreatetime", t.taskCreateTime), new OracleParameter(":taskstate", t.taskState), new OracleParameter(":taskremark", t.taskRemark), new OracleParameter(":taskdbcon", t.taskDBCon), new OracleParameter(":taskclstype", t.taskClsType), new OracleParameter(":tasktype", t.taskType) }; qmdb.ExecuteNonQuery(qmdb.p_trans, CommandType.Text, sql, param); } catch (QMException ex) { throw ex; } }
/// <summary> /// 新的任务记录 /// </summary> /// <param name="t">任务记录类</param> public void Insert(TaskLog t) { try { string sql = @"insert into qm_tasklog (idx, taskid, type, server, createtime, message) values (:idx, :taskid, :type, :server, :createtime, :message)"; OracleParameter[] param = new OracleParameter[] { new OracleParameter(":idx", t.idx), new OracleParameter(":taskid", t.taskid), new OracleParameter(":type", t.type), new OracleParameter(":server", t.server), new OracleParameter(":createtime", t.createtime), new OracleParameter(":message", t.message) }; qmdb.ExecuteNonQuery(sql, CommandType.Text, param); } catch (QMException ex) { throw ex; log.Error(string.Format("TaskLogData=>Insert ERROR:{0}", ex.Message)); } finally { qmdb.Disponse(); } }