Ejemplo n.º 1
0
        private void bindData()
        {
            BLL.wx_ucard_cardinfo   cardBll  = new BLL.wx_ucard_cardinfo();
            Model.wx_ucard_cardinfo cardinfo = cardBll.GetModelBySid(sid);
            if (cardinfo != null)
            {
                imgTopPic.ImageUrl = cardinfo.noticePic;
            }
            BLL.wx_ucard_users   userBll = new BLL.wx_ucard_users();
            Model.wx_ucard_users user    = userBll.GetStoreUserInfo(openid, sid);
            if (user == null)
            {
                return;
            }
            int degreeNum = 0;

            BLL.wx_ucard_fun.userDegree(sid, MyCommFun.Obj2Int(user.ttScore), "", out degreeNum);
            BLL.wx_ucard_notice nBll = new BLL.wx_ucard_notice();

            IList <Model.wx_ucard_notice> nlist = nBll.GetModelList(" sid=" + sid + " and ( userDegree ='0' or userDegree like '%," + degreeNum + ",%' ) order by createDate desc");
            StringBuilder noticeStr             = new StringBuilder();

            if (nlist != null && nlist.Count > 0)
            {
                Model.wx_ucard_notice notice = new Model.wx_ucard_notice();
                for (int i = 0; i < nlist.Count; i++)
                {
                    notice = nlist[i];
                    if (i == 0)
                    {
                        //第一条数据
                        noticeStr.Append("<div id=\"test0-header\" class=\"accordion_headings  header_highlight \">");
                        noticeStr.Append(" <div class=\"tab  new \">");
                        noticeStr.Append(" <span class=\"title\">" + notice.nName + "<p>" + notice.createDate.Value.ToString("yyyy年MM月dd日") + "</p>");
                        noticeStr.Append("  </span></div>");
                        noticeStr.Append(" <div id=\"test0-content\" style=\"display: block; overflow: hidden; opacity: 1;\"> ");
                        noticeStr.Append("<div class=\"accordion_child\"><p class=\"xiangqing\">");
                        noticeStr.Append(notice.nContent);
                        noticeStr.Append(" </p></div></div></div>");
                    }
                    else
                    {
                        noticeStr.Append("<div id=\"test" + i + "-header\" class=\"accordion_headings \">");
                        noticeStr.Append("<div class=\"tab \">");
                        noticeStr.Append("<span class=\"title\">" + notice.nName + "<p>" + notice.createDate.Value.ToString("yyyy年MM月dd日") + "</p></span>");
                        noticeStr.Append("</div>");
                        noticeStr.Append(" <div id=\"test" + i + "-content\" style=\"display: none; overflow: hidden;\">");
                        noticeStr.Append("<div class=\"accordion_child\">");
                        noticeStr.Append("<p class=\"xiangqing\">" + notice.nContent + "</p>");
                        noticeStr.Append("</div> </div> </div>");
                    }
                }
            }
            litNoticeList.Text = noticeStr.ToString();
        }
Ejemplo n.º 2
0
        private void bindData()
        {
            BLL.wx_ucard_cardinfo cardBll = new BLL.wx_ucard_cardinfo();
            Model.wx_ucard_cardinfo cardinfo = cardBll.GetModelBySid(sid);
            if (cardinfo != null)
            {
                imgTopPic.ImageUrl = cardinfo.noticePic;
            }
            BLL.wx_ucard_users userBll = new BLL.wx_ucard_users();
            Model.wx_ucard_users user = userBll.GetStoreUserInfo(openid, sid);
            if (user == null)
            {
                return;
            }
            int degreeNum = 0;
            BLL.wx_ucard_fun.userDegree(sid, MyCommFun.Obj2Int(user.ttScore), "", out degreeNum);
            BLL.wx_ucard_notice nBll = new BLL.wx_ucard_notice();

            IList<Model.wx_ucard_notice> nlist = nBll.GetModelList(" sid=" + sid + " and ( userDegree ='0' or userDegree like '%," + degreeNum + ",%' ) order by createDate desc");
            StringBuilder noticeStr = new StringBuilder();
            if (nlist != null && nlist.Count > 0)
            {
                Model.wx_ucard_notice notice=new Model.wx_ucard_notice();
                for (int i = 0; i < nlist.Count; i++)
                {
                    notice=nlist[i];
                    if (i == 0)
                    {
                        //第一条数据
                        noticeStr.Append("<div id=\"test0-header\" class=\"accordion_headings  header_highlight \">");
                        noticeStr.Append(" <div class=\"tab  new \">");
                        noticeStr.Append(" <span class=\"title\">" + notice.nName+ "<p>"+notice.createDate.Value.ToString("yyyy年MM月dd日")+"</p>");
                        noticeStr.Append("  </span></div>");
                        noticeStr.Append(" <div id=\"test0-content\" style=\"display: block; overflow: hidden; opacity: 1;\"> ");
                        noticeStr.Append("<div class=\"accordion_child\"><p class=\"xiangqing\">");
                        noticeStr.Append(notice.nContent);
                        noticeStr.Append(" </p></div></div></div>");
                    }
                    else
                    {
                        noticeStr.Append("<div id=\"test"+i+"-header\" class=\"accordion_headings \">");
                        noticeStr.Append("<div class=\"tab \">");
                        noticeStr.Append("<span class=\"title\">" + notice.nName + "<p>" + notice.createDate.Value.ToString("yyyy年MM月dd日") + "</p></span>");
                        noticeStr.Append("</div>");
                        noticeStr.Append(" <div id=\"test"+i+"-content\" style=\"display: none; overflow: hidden;\">");
                        noticeStr.Append("<div class=\"accordion_child\">");
                        noticeStr.Append("<p class=\"xiangqing\">"+notice.nContent+"</p>");
                        noticeStr.Append("</div> </div> </div>");
                    }
                }
            
            }
            litNoticeList.Text = noticeStr.ToString();

        }
Ejemplo n.º 3
0
        /// <summary>
        /// 通知,特权,优惠券,礼品券
        /// </summary>
        private void bindNewInfo(Model.wx_ucard_users user)
        {
            //通知列表
            BLL.wx_ucard_notice noticeBll = new BLL.wx_ucard_notice();
            int           noticeNum       = noticeBll.GetRecordCount(" sid=" + id + " and ( userDegree ='0' or userDegree like '%," + degreeNum + ",%' ) ");
            StringBuilder sbStr           = new StringBuilder("");

            if (noticeNum > 0)
            {
                sbStr.Append(" <li><a href=\"ucardNotice.aspx?wid=" + wid + "&sid=" + id + "&openid=" + openid + "\"><span>最新通知<em class=\"ok\">" + noticeNum + "</em></span></a></li>");
            }
            //特权
            BLL.wx_ucard_privileges privilegesBLL = new BLL.wx_ucard_privileges();
            int privilegesNum = privilegesBLL.GetRecordCount(" sid=" + id + " and ( userDegree ='0' or userDegree like '%," + degreeNum + ",%' ) and beginDate<='" + DateTime.Now + "' and endDate>='" + DateTime.Now + "' ");

            if (privilegesNum > 0)
            {
                sbStr.Append(" <li><a href=\"ucardPrivileges.aspx?wid=" + wid + "&sid=" + id + "&openid=" + openid + "\"><span>最新特权<em class=\"ok\">" + privilegesNum + "</em></span></a></li>");
            }

            //优惠券
            BLL.wx_ucard_ticket ticketBLL = new BLL.wx_ucard_ticket();
            string ticketStr = ticketBLL.getUserTicketStr(id, user.id, degreeNum, MyCommFun.Obj2Int(user.consumeMoney, 0));

            if (ticketStr != null)
            {
                string[] strArr    = Utils.SplitString(ticketStr, ",");
                int      ticketNum = 0;
                for (int i = 0; i < strArr.Length; i++)
                {
                    if (strArr[i].Trim().Length > 0)
                    {
                        ticketNum++;
                    }
                }
                sbStr.Append("<li><a href=\"ucardTicket.aspx?wid=" + wid + "&sid=" + id + "&openid=" + openid + "\"><span>会员优惠券<em class=\"ok\">" + ticketNum + "</em></span></a></li>");
            }

            //礼品券
            BLL.wx_ucard_gift giftBll = new BLL.wx_ucard_gift();
            int giftNum = giftBll.GetRecordCount(" sid=" + id + " and   beginDate>='" + DateTime.Now + "' and endDate<'" + DateTime.Now + "'");

            if (giftNum > 0)
            {
                sbStr.Append("<li><a href=\"ucardGift.aspx?wid=" + wid + "&sid=" + id + "&openid=" + openid + "\"><span>会员礼品券<em class=\"ok\">" + giftNum + "</em></span></a></li>");
            }
            litNotice.Text = sbStr.ToString();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 通知,特权,优惠券,礼品券
        /// </summary>
        private void bindNewInfo(Model.wx_ucard_users user)
        { 
            //通知列表
            BLL.wx_ucard_notice noticeBll = new BLL.wx_ucard_notice();
            int noticeNum = noticeBll.GetRecordCount(" sid=" + id + " and ( userDegree ='0' or userDegree like '%," + degreeNum + ",%' ) ");
            StringBuilder sbStr = new StringBuilder("");
            if (noticeNum > 0)
            {
                sbStr.Append(" <li><a href=\"ucardNotice.aspx?wid=" + wid + "&sid=" + id + "&openid=" + openid + "\"><span>最新通知<em class=\"ok\">" + noticeNum + "</em></span></a></li>");
            }
            //特权
            BLL.wx_ucard_privileges privilegesBLL = new BLL.wx_ucard_privileges();
            int privilegesNum = privilegesBLL.GetRecordCount(" sid=" + id + " and ( userDegree ='0' or userDegree like '%," + degreeNum + ",%' ) and beginDate<='" + DateTime.Now + "' and endDate>='" + DateTime.Now + "' ");
            if (privilegesNum > 0)
            {
                sbStr.Append(" <li><a href=\"ucardPrivileges.aspx?wid=" + wid + "&sid=" + id + "&openid=" + openid + "\"><span>最新特权<em class=\"ok\">" + privilegesNum + "</em></span></a></li>");
            }

            //优惠券
            BLL.wx_ucard_ticket ticketBLL = new BLL.wx_ucard_ticket();
            string ticketStr = ticketBLL.getUserTicketStr(id, user.id, degreeNum, MyCommFun.Obj2Int(user.consumeMoney, 0));
            if (ticketStr != null)
            {
                string[] strArr = Utils.SplitString(ticketStr, ",");
                int ticketNum = 0;
                for (int i = 0; i < strArr.Length; i++)
                {
                    if (strArr[i].Trim().Length > 0)
                    {
                        ticketNum++;
                    }
                }
                sbStr.Append("<li><a href=\"ucardTicket.aspx?wid="+wid+"&sid="+id+"&openid="+openid+"\"><span>会员优惠券<em class=\"ok\">" + ticketNum + "</em></span></a></li>");
            }

            //礼品券
            BLL.wx_ucard_gift giftBll = new BLL.wx_ucard_gift();
            int giftNum = giftBll.GetRecordCount(" sid=" + id + " and   beginDate>='" + DateTime.Now + "' and endDate<'" + DateTime.Now + "'");
            if (giftNum > 0)
            {
                sbStr.Append("<li><a href=\"ucardGift.aspx?wid=" + wid + "&sid=" + id + "&openid=" + openid + "\"><span>会员礼品券<em class=\"ok\">" + giftNum + "</em></span></a></li>");
            }
            litNotice.Text = sbStr.ToString();

        }