Exemplo n.º 1
0
        internal Weixin_template GetWeixinTmpl(int comid, string infotype)
        {
            string sql = @"SELECT [id]
      ,[comid]
      ,[infotype]
      ,[template_id]
      ,[template_name]
      ,[first_DATA]
      ,[remark_DATA]
  FROM [EtownDB].[dbo].[weixin_template] where comid=@comid and infotype=@infotype";

            var cmd = sqlHelper.PrepareTextSqlCommand(sql);

            cmd.AddParam("@comid", comid);
            cmd.AddParam("@infotype", infotype);

            using (var reader = cmd.ExecuteReader())
            {
                Weixin_template m = null;
                if (reader.Read())
                {
                    m = new Weixin_template
                    {
                        Id            = reader.GetValue <int>("id"),
                        Comid         = reader.GetValue <int>("comid"),
                        Infotype      = reader.GetValue <string>("infotype"),
                        Template_id   = reader.GetValue <string>("template_id"),
                        Template_name = reader.GetValue <string>("template_name"),
                        First_DATA    = reader.GetValue <string>("first_data"),
                        Remark_DATA   = reader.GetValue <string>("remark_data")
                    };
                }
                return(m);
            }
        }
Exemplo n.º 2
0
        internal Weixin_template Templatemodelinfo(int id)
        {
            string sql = @"SELECT * FROM [weixin_template_model] where id=@id";

            var cmd = sqlHelper.PrepareTextSqlCommand(sql);

            cmd.AddParam("@id", id);

            using (var reader = cmd.ExecuteReader())
            {
                Weixin_template m = null;
                if (reader.Read())
                {
                    m = new Weixin_template
                    {
                        Id            = reader.GetValue <int>("id"),
                        Template_id   = reader.GetValue <string>("Template_id"),
                        First_DATA    = reader.GetValue <string>("First_DATA"),
                        Remark_DATA   = reader.GetValue <string>("Remark_DATA"),
                        Infotype      = reader.GetValue <string>("Infotype"),
                        Template_name = reader.GetValue <string>("Template_name")
                    };
                }
                return(m);
            }
        }