Exemple #1
0
        public tb_MaterialExtEntity GetMaterialExtByToolbar(string weixincode, string eventkey)
        {
            tb_ToolbarEntity Obj = new tb_ToolbarEntity();

            SqlParameter[] _param =
            {
                new SqlParameter("@eventkey",   SqlDbType.VarChar, 50),
                new SqlParameter("@weixincode", SqlDbType.VarChar, 50)
            };
            _param[0].Value = eventkey;
            _param[1].Value = weixincode;
            string sqlStr = "select top 1 * from tb_Toolbar where Params=@eventkey and WeiXinCode=@weixincode";

            using (SqlDataReader dr = SqlHelper.ExecuteReader(WebConfig.weixinRW, CommandType.Text, sqlStr, _param))
            {
                while (dr.Read())
                {
                    Obj = Populate_tb_ToolbarEntity_FromDr(dr);
                }
            }
            if (Obj.MaterialID == 0)
            {
                return(null);
            }

            tb_MaterialDataAccessLayer dal = new tb_MaterialDataAccessLayer();

            return(dal.GetMaterialExt(Obj.MaterialID));
        }
        public tb_MaterialExtEntity GetMaterialExtEntityByWeiXinCode(string weixincode)
        {
            tb_SubscriptionEntity Obj = GetModelByWeiXinCode(weixincode);

            if (Obj == null || Obj.MaterialID == 0)
            {
                return(null);
            }
            tb_MaterialDataAccessLayer dal = new tb_MaterialDataAccessLayer();

            return(dal.GetMaterialExt(Obj.MaterialID));
        }