Пример #1
0
        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
        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;
        }
Пример #3
0
        public virtual bool Edit(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)
            };
            Par.Add(new ProcedureParameter("@id",  model.id));

            int rev = PubConn.ExecuteSql("update tb_log set mqpathid=@mqpathid,mqpath=@mqpath,methodname=@methodname,info=@info,createtime=@createtime where id=@id", Par);
            return rev == 1;
        }