Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OnlyWeiXinLook();
            if (!IsPostBack)
            {
                int    xid    = MyCommFun.RequestInt("xid");
                int    wid    = MyCommFun.RequestInt("wid");
                string openid = MyCommFun.RequestOpenid();
                if (wid == 0 || openid == "")
                {
                    MessageBox.Show(this, "参数不正确!");
                    return;
                }

                if (xid > 0 && wid > 0)
                {
                    BLL.wx_xt_base bll = new BLL.wx_xt_base();
                    xitie       = bll.GetModel(xid);
                    xitie.music = MyCommFun.getWebSite() + xitie.music;
                    this.Title  = xitie.wxTitle;
                    BLL.wx_xt_photo           pbll  = new BLL.wx_xt_photo();
                    IList <Model.wx_xt_photo> plist = pbll.GetModelList("bId=" + xid);
                    if (plist == null || plist.Count <= 0)
                    {
                        return;
                    }
                    for (int i = 0; i < plist.Count; i++)
                    {
                        photolistStr += "<li class=\"pb_10\"><img src=\"" + plist[i].pUrl + "\" style=\"width: 100%;\"></li>";
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// 喜帖
        /// </summary>
        /// <param name="id"></param>
        /// <param name="apiid"></param>
        /// <param name="openid"></param>
        /// <returns></returns>
        private IList <Model.ResponseContentEntity> xitieReponse(int id, int apiid, string openid)
        {
            IList <Model.ResponseContentEntity> responselist = new List <Model.ResponseContentEntity>();

            Model.ResponseContentEntity responseEntity = new Model.ResponseContentEntity();
            responseEntity.id  = id;
            responseEntity.wid = apiid;


            BLL.wx_xt_base   xtBll    = new BLL.wx_xt_base();
            Model.wx_xt_base actModel = xtBll.GetModel(id);
            if (actModel.statedate < DateTime.Now)
            {  //活动尚未开始
                responseEntity.rcType   = Model.ReponseContentType.text;
                responseEntity.rContent = "【" + actModel.wxTitle + "】将于" + actModel.statedate + "举办,现已经结束";
            }

            else
            {
                //活动正在进行中

                responseEntity.rcType    = Model.ReponseContentType.txtpic;
                responseEntity.rContent  = actModel.wxTitle;
                responseEntity.rContent2 = actModel.word;
                responseEntity.detailUrl = MyCommFun.getWebSite() + "/weixin/xitie/index.aspx?wid=" + apiid + "&xid=" + id;
                responseEntity.picUrl    = actModel.fengmian;
            }

            responselist.Add(responseEntity);
            return(responselist);
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OnlyWeiXinLook();
            if (!IsPostBack)
            {
                int xid = MyCommFun.RequestInt("xid");
                int  wid = MyCommFun.RequestInt("wid");
               string  openid = MyCommFun.RequestOpenid();
                if (wid == 0 || openid=="")
                {
                    MessageBox.Show(this, "参数不正确!");
                    return;
                }

                if (xid > 0 && wid>0)
                {

                    BLL.wx_xt_base bll = new BLL.wx_xt_base();
                    xitie = bll.GetModel(xid);
                    xitie.music = MyCommFun.getWebSite() + xitie.music;
                    this.Title = xitie.wxTitle;
                    BLL.wx_xt_photo pbll = new BLL.wx_xt_photo();
                    IList<Model.wx_xt_photo> plist = pbll.GetModelList("bId=" + xid );
                    if (plist == null || plist.Count <= 0)
                    {
                        return;
                    }
                    for (int i = 0; i < plist.Count; i++)
                    {
                        photolistStr += "<li class=\"pb_10\"><img src=\"" + plist[i].pUrl + "\" style=\"width: 100%;\"></li>";

                    }
                }

                

            }


        }
        /// <summary>
        /// 喜帖
        /// </summary>
        /// <param name="id"></param>
        /// <param name="apiid"></param>
        /// <param name="openid"></param>
        /// <returns></returns>
        private IList<Model.ResponseContentEntity> xitieReponse(int id, int apiid, string openid)
        {
            IList<Model.ResponseContentEntity> responselist = new List<Model.ResponseContentEntity>();
            Model.ResponseContentEntity responseEntity = new Model.ResponseContentEntity();
            responseEntity.id = id;
            responseEntity.wid = apiid;


            BLL.wx_xt_base xtBll = new BLL.wx_xt_base();
            Model.wx_xt_base actModel = xtBll.GetModel(id);
            if (actModel.statedate < DateTime.Now)
            {  //活动尚未开始 
                responseEntity.rcType = Model.ReponseContentType.text;
                responseEntity.rContent = "【" + actModel.wxTitle + "】将于" + actModel.statedate + "举办,现已经结束";

            }

            else
            {
                //活动正在进行中

                responseEntity.rcType = Model.ReponseContentType.txtpic;
                responseEntity.rContent = actModel.wxTitle;
                responseEntity.rContent2 = actModel.word;
                responseEntity.detailUrl = MyCommFun.getWebSite() + "/weixin/xitie/index.aspx?wid=" + apiid + "&xid=" + id;
                responseEntity.picUrl = actModel.fengmian;

            }

            responselist.Add(responseEntity);
            return responselist;
        }