コード例 #1
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();
        }
コード例 #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.privilegesPic;
            }
            BLL.wx_ucard_users   userBll = new BLL.wx_ucard_users();
            Model.wx_ucard_users user    = userBll.GetStoreUserInfo(openid, sid);
            if (user == null)
            {
                return;
            }
            uid = user.id;
            int degreeNum = 0;

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

            string ticketStr = ticketBLL.getUserTicketStr(sid, user.id, degreeNum, MyCommFun.Obj2Int(user.consumeMoney, 0));

            IList <Model.wx_ucard_ticket> plist = ticketBLL.GetModelList(" id in " + comStrByTid(ticketStr));
            StringBuilder pStr = new StringBuilder();

            if (plist != null && plist.Count > 0)
            {
                Model.wx_ucard_ticket ticket = new Model.wx_ucard_ticket();
                string sn    = "";
                int    syNum = 0; //剩余次数
                for (int i = 0; i < plist.Count; i++)
                {
                    ticket = plist[i];
                    syNum  = MyCommFun.Obj2Int(ticket.usedTimes);
                    sn     = Utils.Number(16, true);
                    if (i == 0)
                    {
                        //第一条数据
                        pStr.Append(" <div id=\"test0-header\" class=\"accordion_headings  header_highlight \">");
                        pStr.Append(" <div class=\"tab  coupon \">");
                        pStr.Append(" <span class=\"title\">" + ticket.tName + "(<span id=\"cid" + ticket.id + "\">" + syNum + "</span>张)<p>有效期至" + ticket.endDate.Value.ToString("yyyy年MM月dd日") + "</p></span>");
                        pStr.Append(" </div>");
                        pStr.Append(" <div id=\"test0-content\" style=\"display: block; overflow: hidden; opacity: 1;\">");
                        pStr.Append(" <div class=\"accordion_child\">");
                        pStr.Append("  <p class=\"num\" onclick=\"jQ('#test0-content').height(300);document.getElementById('queren0').style.display=''\" id=\"sn0\">" + sn + "</p>");
                        pStr.Append("  <div id=\"queren0\" style=\"display: none\">");
                        pStr.Append("  <p style=\"margin: 10px 0\">");
                        pStr.Append(" <input name=\"\" type=\"text\" class=\"px\" id=\"money0\" value=\"\" placeholder=\"请输入实际消费金额\">");
                        pStr.Append(" </p> <p style=\"margin: 10px 0\">");
                        pStr.Append(" <input name=\"\" type=\"text\" class=\"px\" id=\"bmoney0\" value=\"\" placeholder=\"请再次输入实际消费金额\">");
                        pStr.Append(" </p>  <p style=\"margin: 10px 0 0 0\">");
                        pStr.Append("  <input name=\"\" class=\"px\" id=\"parssword0\" value=\"\" type=\"password\" placeholder=\"请输入管理员密码\">");
                        pStr.Append("  </p> <p style=\"margin: 10px 0\">");
                        pStr.Append("<a id=\"showcard0\" class=\"submit\" href=\"javascript:void(0)\" onclick=\"coupon(0,'" + sn + "','" + ticket.id + "')\">确定使用</a>");
                        pStr.Append("   </p> </div>");
                        pStr.Append("  <p class=\"explain_sn\"><span>点击处理</span></p>");
                        pStr.Append(" <b>详情说明</b>");
                        pStr.Append("<ul>" + ticket.usedContent + "</ul></div> </div> </div>");
                    }
                    else
                    {
                        pStr.Append(" <div id=\"test" + i + "-header\" class=\"accordion_headings \">");
                        pStr.Append("  <div class=\"tab  coupon \">");
                        pStr.Append(" <span class=\"title\">" + ticket.tName + "(<span id=\"cid" + ticket.id + "\">" + syNum + "</span>张)<p>有效期至" + ticket.endDate.Value.ToString("yyyy年MM月dd日") + "</p>");
                        pStr.Append(" </span>  </div>");
                        pStr.Append(" <div id=\"test" + i + "-content\" style=\"display: none; overflow: hidden;\">");
                        pStr.Append("  <div class=\"accordion_child\">");
                        pStr.Append("<p class=\"num\" onclick=\"jQ('#test" + i + "-content').height(300);document.getElementById('queren" + i + "').style.display=''\" id=\"sn" + i + "\">" + sn + "</p>");
                        pStr.Append("<div id=\"queren" + i + "\" style=\"display: none\">  <p style=\"margin: 10px 0\">");
                        pStr.Append("  <input name=\"\" type=\"text\" class=\"px\" id=\"money" + i + "\" value=\"\" placeholder=\"请输入实际消费金额\">");
                        pStr.Append("  </p>  <p style=\"margin: 10px 0\">");
                        pStr.Append(" <input name=\"\" type=\"text\" class=\"px\" id=\"bmoney" + i + "\" value=\"\" placeholder=\"请再次输入实际消费金额\">");
                        pStr.Append("  </p> <p style=\"margin: 10px 0 0 0\">");
                        pStr.Append("  <input name=\"\" class=\"px\" id=\"parssword" + i + "\" value=\"\" type=\"password\" placeholder=\"请输入管理员密码\">");
                        pStr.Append("   </p><p style=\"margin: 10px 0\">");
                        pStr.Append(" <a id=\"showcard" + i + "\" class=\"submit\" href=\"javascript:void(0)\" onclick=\"coupon(" + i + ",'" + sn + "','" + ticket.id + "')\">确定使用</a>");
                        pStr.Append("  </p></div>");
                        pStr.Append(" <p class=\"explain_sn\"><span>点击处理</span></p>");
                        pStr.Append("  <b>详情说明</b>");
                        pStr.Append("  <ul>" + ticket.usedContent + "</ul></div> </div> </div>");
                    }
                }
            }
            litTicketlist.Text = pStr.ToString();
        }
コード例 #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();

        }