Пример #1
0
        public void List(string openid)
        {
            DataSet dr = managebll.GetPayList(openid);

            if (dr.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < dr.Tables[0].Rows.Count; i++)
                {
                    str += "<ul class=\"round\">";
                    str += "<li class=\"title\"><a href=\"diancai_dingdan.aspx?shopid=" + shopid + "&dingdan=" + dr.Tables[0].Rows[i]["id"].ToString() + "&openid=" + openid + "\"><span>" + dr.Tables[0].Rows[i]["oderTime"].ToString() + " </span></a></li>";
                    str += " <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"cpbiaoge\">";
                    str += "<tr><th>订单编号</th>";
                    str += "<th width=\"70\" class=\"cc\">订单金额</th><th width=\"55\" class=\"cc\">订单状态</th></tr>";
                    str += "<tr><td>" + dr.Tables[0].Rows[i]["orderNumber"].ToString() + "</td><td class=\"cc\">" + dr.Tables[0].Rows[i]["payAmount"].ToString() + "元</td>";
                    str += "<td class=\"cc\"> ";
                    if (dr.Tables[0].Rows[i]["payStatus"].ToString() == "1")
                    {
                        str += "<em class=\"ok\">成功</em>";
                    }
                    else if (dr.Tables[0].Rows[i]["payStatus"].ToString() == "2")
                    {
                        str += "<em class=\"error\">失败</em>";
                    }
                    else
                    {
                        str += "<em class=\"no\">未处理</em>";
                    }
                    str += " </td></tr></table></ul>";
                }
            }
        }
Пример #2
0
        public void GetPay(string openID)
        {
            var     managebll = new BLL.wx_diancai_dingdan_manage();
            DataSet dr        = managebll.GetPayList(openID);

            if (dr.Tables[0].Rows.Count > 0)
            {
                var detailBuilder = new StringBuilder();
                for (int i = 0; i < dr.Tables[0].Rows.Count; i++)
                {
                    var    payStatus = dr.Tables[0].Rows[i]["payStatus"].ToString();
                    string payStatusText;
                    string payStatusCss = string.Empty;
                    switch (payStatus)
                    {
                    case "1":
                        payStatusText = "等待使用";
                        break;

                    case "2":
                    case "4":     //部分退款
                        payStatusText = "未使用";
                        payStatusCss  = "status-refundPart";
                        break;

                    case "3":
                        payStatusText = "已使用";
                        //payStatusCss = "status-refundAll";
                        break;

                    case "5":    //全部退款
                        payStatusText = "未使用";
                        payStatusCss  = "status-refundAll";
                        break;

                    default:
                        payStatusText = "未处理";
                        break;
                    }

                    detailBuilder.Append("<ul>");
                    detailBuilder.Append("<li>");
                    detailBuilder.AppendFormat("<a href=\"diancai_orderDetail.aspx?wid={0}&shopid={1}&dingdan={2}&openid={3}\">",
                                               dr.Tables[0].Rows[i]["wid"].ToString(),
                                               dr.Tables[0].Rows[i]["shopinfoid"].ToString(),
                                               dr.Tables[0].Rows[i]["id"].ToString(),
                                               openId
                                               );
                    detailBuilder.Append("<div class=\"info_01\">");

                    if (!string.IsNullOrEmpty(payStatusCss))
                    {
                        detailBuilder.AppendFormat("<i class=\"{0} i-status\"></i>", payStatusCss);
                    }

                    detailBuilder.AppendFormat("<h3>{0}</h3>", dr.Tables[0].Rows[i].Field <string>("hotelName"));
                    detailBuilder.AppendFormat("<p>实付<b>¥{0}</b>共<b>{1}</b>件商品</p>", dr.Tables[0].Rows[i]["payAmount"].ToString(), dr.Tables[0].Rows[i]["OrderCount"].ToString());
                    detailBuilder.Append("<span class=\"wave_blue_icon\"></span>");
                    detailBuilder.Append("</div>");
                    detailBuilder.Append("<div class=\"info_02\">");
                    detailBuilder.Append("<dl>");
                    detailBuilder.AppendFormat("<dd><b class=\"i_gray_icon\"></b>订单编号 {0}</dd>", dr.Tables[0].Rows[i]["orderNumber"].ToString());
                    detailBuilder.AppendFormat("<dd><b class=\"time_gray_icon\"></b>购票日期 {0}</dd>", dr.Tables[0].Rows[i]["oderTime"].ToString());
                    //此处应该有购票日期
                    detailBuilder.Append("</dl>");
                    detailBuilder.Append("</div>");
                    detailBuilder.Append("<div class=\"info_03\">");
                    detailBuilder.AppendFormat("<span>{0}</span>", payStatusText);
                    detailBuilder.Append("</div>");
                    detailBuilder.Append("</a>");
                    detailBuilder.Append("</li>");
                    detailBuilder.Append("</ul>");
                }

                str = detailBuilder.ToString();
            }
        }