using Dapper; using NetCore.Model.enums; using NetCore.Model.qw; using System.Data; namespace NetCore.BLL { public class hg_excute_log_bll { private string comcode; public hg_excute_log_bll(string _comcode) { comcode = _comcode; } /// /// 记录执行日志 /// /// /// public bool Log(hg_excute_log model) { using (IDbConnection con = ConnectionFactory.CreateConnection(ContextType.qwContext, comcode)) { if (model.message.Length > 240) { model.message = model.message.Substring(0, 240);//排除多余得字符 } return con.Execute(@"insert into hg_excute_log(pici,corpid,name,tablename,seq,starttime,endtime,exscend,message,status) values(@pici,@corpid,@name,@tablename,@seq,@starttime,@endtime,@exscend,@message,@status)", model) > 0; } } /// /// 记录执行日志 /// /// /// public bool LogCrm(hg_excete_log_crm model) { using (IDbConnection con = ConnectionFactory.CreateConnection(ContextType.crmContext, comcode)) { if (model.message.Length > 240) { model.message = model.message.Substring(0, 240);//排除多余得字符 } return con.Execute(@"insert into hg_excute_log (id, type, starttime, endtime, exscend, message, status) values (pack_base.Seq_smallid_get, :type, :starttime, :endtime, :exscend, :message, :status)", model) > 0; } } /// /// 记录执行日志 /// /// /// public bool LogWX(hg_excete_log_crm model) { using (IDbConnection con = ConnectionFactory.CreateConnection(ContextType.wxContext, comcode)) { if (model.message.Length > 240) { model.message = model.message.Substring(0, 240);//排除多余得字符 } return con.Execute(@"insert into hg_excute_log (type, starttime, endtime, exscend, message, status,tablename) values ( @type, @starttime, @endtime, @exscend, @message, @status,@tablename)", model) > 0; } } } }