public Model.TaskRunLog StartRunLog(RLib.DB.DbConn dbconn, Model.TaskRunLog model) { string sql = "insert into taskrunlog(runguid,taskid,nodeid,runtype,runservertime,logtext) values " + " (@runguid,@taskid,@nodeid,@runtype,@runservertime,@logtext)"; dbconn.ExecuteSql(sql, new { runguid = model.RunGuid ?? "", taskid = model.TaskId, nodeid = model.NodeId, runtype = model.RunType, runservertime = model.RunServerTime, logtext = model.LogText ?? "" }); model.LogId = dbconn.GetIdentity(); return(model); }
public int EndRunLog(RLib.DB.DbConn dbconn, Model.TaskRunLog model) { string sql = "update taskrunlog set " + " endservertime=@endservertime " + ", enddbtime = getdate()" + ",resulttype=@resulttype " + ", logtext=@logtext " + " where taskid=@taskid and nodeid=@nodeid and runguid=@runguid; "; int r = dbconn.ExecuteSql(sql, new { runguid = model.RunGuid ?? "", taskid = model.TaskId, nodeid = model.NodeId, resulttype = model.ResultType, endservertime = model.EndServerTime, logtext = model.LogText ?? "" }); return(r); }
public JsonEntity TaskEndLog(string ClientId, int taskId, string runGuid, int resultType, string logText, DateTime time) { using (RLib.DB.DbConn dbconn = Pub.GetConn()) { var nodemodel = nodedal.Detail(dbconn, ClientId); Model.TaskRunLog taskrunlogmodel = new Model.TaskRunLog() { NodeId = nodemodel.NodeId, TaskId = taskId, RunGuid = runGuid ?? "", ResultType = resultType, EndServerTime = time, LogText = logText ?? "" }; tasklogdal.EndRunLog(dbconn, taskrunlogmodel); return(new JsonEntity() { code = 1 }); } }
public JsonEntity TaskBeginLog(string ClientId, int taskId, string runGuid, int runType, DateTime time) { using (RLib.DB.DbConn dbconn = Pub.GetConn()) { var nodemodel = nodedal.Detail(dbconn, ClientId); Model.TaskRunLog taskrunlogmodel = new Model.TaskRunLog() { NodeId = nodemodel.NodeId, ResultType = 0, TaskId = taskId, RunType = runType, RunServerTime = time, RunGuid = runGuid ?? "" }; tasklogdal.StartRunLog(dbconn, taskrunlogmodel); taskdal.UpdateTaskLastRunTime(dbconn, nodemodel.NodeId, taskId); return(new JsonEntity() { code = 1 }); } }