示例#1
0
文件: tb_log_dal.cs 项目: xwx2015/MQ
        public virtual bool Add(DbConn PubConn, tb_log_model model)
        {
            List<ProcedureParameter> Par = new List<ProcedureParameter>()
                {

                    //
                    new ProcedureParameter("@mqpathid",    model.mqpathid),
                    //
                    new ProcedureParameter("@mqpath",    model.mqpath),
                    //
                    new ProcedureParameter("@methodname",    model.methodname),
                    //
                    new ProcedureParameter("@info",    model.info),
                    //
                    new ProcedureParameter("@createtime",    model.createtime)
                };
            int rev = PubConn.ExecuteSql(@"insert into tb_log(mqpathid,mqpath,methodname,info,createtime)
                                           values(@mqpathid,@mqpath,@methodname,@info,@createtime)", Par);
            return rev == 1;
        }
示例#2
0
文件: tb_log_dal.cs 项目: xwx2015/MQ
        public virtual tb_log_model CreateModel(DataRow dr)
        {
            var o = new tb_log_model();

            //
            if(dr.Table.Columns.Contains("id"))
            {
                o.id = dr["id"].Tolong();
            }
            //
            if(dr.Table.Columns.Contains("mqpathid"))
            {
                o.mqpathid = dr["mqpathid"].Toint();
            }
            //
            if(dr.Table.Columns.Contains("mqpath"))
            {
                o.mqpath = dr["mqpath"].Tostring();
            }
            //
            if(dr.Table.Columns.Contains("methodname"))
            {
                o.methodname = dr["methodname"].Tostring();
            }
            //
            if(dr.Table.Columns.Contains("info"))
            {
                o.info = dr["info"].Tostring();
            }
            //
            if(dr.Table.Columns.Contains("createtime"))
            {
                o.createtime = dr["createtime"].ToDateTime();
            }
            return o;
        }