/// <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); } }
public ActionResult Log(string keyword, string CStime, string CEtime, int id = -1, int logtype = -1, int taskid = -1, int nodeid = -1, int pagesize = 10, int pageindex = 1) { return this.Visit(Core.EnumUserRole.None, () => { ViewBag.keyword = keyword; ViewBag.CStime = CStime; ViewBag.CEtime = CEtime; ViewBag.id = id; ViewBag.logtype = logtype; ViewBag.taskid = taskid; ViewBag.nodeid = nodeid; ViewBag.pagesize = pagesize; ViewBag.pageindex = pageindex; int count = 0; using (DbConn PubConn = DbConfig.CreateConn(Config.TaskConnectString)) { PubConn.Open(); tb_log_dal dal = new tb_log_dal(); List<tb_loginfo_model> model = dal.GetList(PubConn, keyword, id, CStime, CEtime, logtype, taskid, nodeid, pagesize, pageindex, out count); PagedList<tb_loginfo_model> pageList = new PagedList<tb_loginfo_model>(model, pageindex, pagesize, count); List<tb_task_model> Task = new tb_task_dal().GetListAll(PubConn); List<tb_node_model> Node = new tb_node_dal().GetListAll(PubConn); ViewBag.Node = Node; ViewBag.Task = Task; return View(pageList); } }); }