public virtual bool Add(DbConn PubConn, tb_timewatchlog_api_model model)
        {
            List <ProcedureParameter> Par = new List <ProcedureParameter>()
            {
                //
                new ProcedureParameter("@sqlservercreatetime", model.sqlservercreatetime),
                //
                new ProcedureParameter("@logcreatetime", model.logcreatetime),
                //
                new ProcedureParameter("@time", model.time),
                //
                new ProcedureParameter("@projectname", model.projectname),
                //
                new ProcedureParameter("@url", model.url),
                //
                new ProcedureParameter("@msg", model.msg),
                //
                new ProcedureParameter("@fromip", model.fromip),
                //
                new ProcedureParameter("@tag", model.tag)
            };
            int rev = PubConn.ExecuteSql(@"insert into tb_timewatchlog_api(sqlservercreatetime,logcreatetime,time,projectname,url,msg,fromip,tag)
										   values(@sqlservercreatetime,@logcreatetime,@time,@projectname,@url,@msg,@fromip,@tag)"                                        , Par);

            return(rev == 1);
        }
        public virtual bool Edit(DbConn PubConn, tb_timewatchlog_api_model model)
        {
            List <ProcedureParameter> Par = new List <ProcedureParameter>()
            {
                //
                new ProcedureParameter("@sqlservercreatetime", model.sqlservercreatetime),
                //
                new ProcedureParameter("@logcreatetime", model.logcreatetime),
                //
                new ProcedureParameter("@time", model.time),
                //
                new ProcedureParameter("@projectname", model.projectname),
                //
                new ProcedureParameter("@url", model.url),
                //
                new ProcedureParameter("@msg", model.msg),
                //
                new ProcedureParameter("@fromip", model.fromip),
                //
                new ProcedureParameter("@tag", model.tag)
            };

            Par.Add(new ProcedureParameter("@id", model.id));

            int rev = PubConn.ExecuteSql("update tb_timewatchlog_api set sqlservercreatetime=@sqlservercreatetime,logcreatetime=@logcreatetime,time=@time,projectname=@projectname,url=@url,msg=@msg,fromip=@fromip,tag=@tag where id=@id", Par);

            return(rev == 1);
        }
        public virtual tb_timewatchlog_api_model CreateModel(DataRow dr)
        {
            var o = new tb_timewatchlog_api_model();

            //
            if (dr.Table.Columns.Contains("id"))
            {
                o.id = dr["id"].Toint();
            }
            //
            if (dr.Table.Columns.Contains("sqlservercreatetime"))
            {
                o.sqlservercreatetime = dr["sqlservercreatetime"].ToDateTime();
            }
            //
            if (dr.Table.Columns.Contains("logcreatetime"))
            {
                o.logcreatetime = dr["logcreatetime"].ToDateTime();
            }
            //
            if (dr.Table.Columns.Contains("time"))
            {
                o.time = dr["time"].Todouble();
            }
            //
            if (dr.Table.Columns.Contains("projectname"))
            {
                o.projectname = dr["projectname"].Tostring();
            }
            //
            if (dr.Table.Columns.Contains("url"))
            {
                o.url = dr["url"].Tostring();
            }
            //
            if (dr.Table.Columns.Contains("msg"))
            {
                o.msg = dr["msg"].Tostring();
            }
            //
            if (dr.Table.Columns.Contains("fromip"))
            {
                o.fromip = dr["fromip"].Tostring();
            }
            //
            if (dr.Table.Columns.Contains("tag"))
            {
                o.tag = dr["tag"].Tostring();
            }
            return(o);
        }