コード例 #1
0
        public int Add2(DbConn PubConn, tb_log_model model)
        {
            return SqlHelper.Visit(ps =>
            {
                ps.Add("@msg", model.msg);
                ps.Add("@logtype", model.logtype);
                ps.Add("@logcreatetime", model.logcreatetime);
                ps.Add("@taskid", model.taskid);
                ps.Add("@nodeid", model.nodeid);
                return PubConn.ExecuteSql(@"insert into tb_log(msg,logtype,logcreatetime,taskid,nodeid)
										   values(@msg,@logtype,@logcreatetime,@taskid,@nodeid)", ps.ToParameters());
            });
        }
コード例 #2
0
 /// <summary>
 /// 添加节点日志
 /// </summary>
 /// <param name="msg"></param>
 public static void AddNodeLog(string msg)
 {
     CommLog.Write(msg);
     tb_log_model model = new tb_log_model()
     {
         logcreatetime = DateTime.Now,
         logtype = (byte)XXF.BaseService.TaskManager.SystemRuntime.EnumTaskLogType.SystemLog,
         msg = msg,
         taskid = 0,
         nodeid = GlobalConfig.NodeID
     };
     AddLog(model);
 }
コード例 #3
0
 /// <summary>
 /// 添加日志
 /// </summary>
 /// <param name="model"></param>
 public static void AddLog(tb_log_model model)
 {
     try
     {
         SqlHelper.ExcuteSql(Config.TaskConnectString, (c) =>
         {
             tb_log_dal logdal = new tb_log_dal();
             model.msg = model.msg.SubString2(1000);
             logdal.Add2(c, model);
         });
     }
     catch (Exception exp)
     {
         XXF.Log.ErrorLog.Write("添加日志至数据库出错", exp);
     }
 }
コード例 #4
0
        public virtual bool Edit(DbConn PubConn, tb_log_model model)
        {
            List<ProcedureParameter> Par = new List<ProcedureParameter>()
            {
                    
					//
					new ProcedureParameter("@msg",    model.msg),
					//
					new ProcedureParameter("@logtype",    model.logtype),
					//
					new ProcedureParameter("@logcreatetime",    model.logcreatetime),
					//
					new ProcedureParameter("@taskid",    model.taskid),
					//
					new ProcedureParameter("@nodeid",    model.nodeid)
            };
			Par.Add(new ProcedureParameter("@id",  model.id));

            int rev = PubConn.ExecuteSql("update tb_log set msg=@msg,logtype=@logtype,logcreatetime=@logcreatetime,taskid=@taskid,nodeid=@nodeid where id=@id", Par);
            return rev == 1;

        }
コード例 #5
0
        public virtual bool Add(DbConn PubConn, tb_log_model model)
        {

            List<ProcedureParameter> Par = new List<ProcedureParameter>()
                {
					
					//
					new ProcedureParameter("@msg",    model.msg),
					//
					new ProcedureParameter("@logtype",    model.logtype),
					//
					new ProcedureParameter("@logcreatetime",    model.logcreatetime),
					//
					new ProcedureParameter("@taskid",    model.taskid),
					//
					new ProcedureParameter("@nodeid",    model.nodeid)   
                };
            int rev = PubConn.ExecuteSql(@"insert into tb_log(msg,logtype,logcreatetime,taskid,nodeid)
										   values(@msg,@logtype,@logcreatetime,@taskid,@nodeid)", Par);
            return rev == 1;

        }
コード例 #6
0
		public virtual tb_log_model CreateModel(DataRow dr)
        {
            var o = new tb_log_model();
			
			//
			if(dr.Table.Columns.Contains("id"))
			{
				o.id = dr["id"].Toint();
			}
			//
			if(dr.Table.Columns.Contains("msg"))
			{
				o.msg = dr["msg"].Tostring();
			}
			//
			if(dr.Table.Columns.Contains("logtype"))
			{
				o.logtype = dr["logtype"].ToByte();
			}
			//
			if(dr.Table.Columns.Contains("logcreatetime"))
			{
				o.logcreatetime = dr["logcreatetime"].ToDateTime();
			}
			//
			if(dr.Table.Columns.Contains("taskid"))
			{
				o.taskid = dr["taskid"].Toint();
			}
			//
			if(dr.Table.Columns.Contains("nodeid"))
			{
				o.nodeid = dr["nodeid"].Toint();
			}
			return o;
        }
コード例 #7
0
 /// <summary>
 /// 添加任务日志
 /// </summary>
 /// <param name="msg"></param>
 public static void AddTaskLog(string msg, int taskid)
 {
     tb_log_model model = new tb_log_model()
     {
         logcreatetime = DateTime.Now,
         logtype = (byte)XXF.BaseService.TaskManager.SystemRuntime.EnumTaskLogType.CommonLog,
         msg = msg,
         taskid = taskid,
         nodeid = GlobalConfig.NodeID
     };
     AddLog(model);
 }