//绑定所有订单 public void BindAllOrder() { string uid = Session["uname"].ToString(); //根据订单类型绑定订单 DataTable dt = orderbll.BindOrder(uid); string ordernum = ""; foreach (DataRow Row in dt.Rows) { if (ordernum != Row["orderNum"].ToString()) { ordernum = Row["orderNum"].ToString(); //绑定商品 DataTable dt1 = orderbll.BindOrderPro(uid, ordernum); double result = 0; AllOrder.InnerHtml += "<div class='order-status5' id='order'>" + "<div class='order-title'>" + "<div class='dd-num'>" + "订单编号:" + "<a href = 'javascript:;' >" + $"{Row["orderNum"]}" + "</a>" + "</div>" + "<span>" + $"{Row["orderTime"]}" + "</span>" + "</div>" + "<div class='order-content'>" + "<div class='order-left'>"; foreach (DataRow Row1 in dt1.Rows) { double a = Convert.ToInt32(Row1["num"]) * Convert.ToDouble(Row1["ProPrice"]); result += a; string pic = Row1["Picture"].ToString().Split(';')[0]; AllOrder.InnerHtml += "<ul class='item-list'>" + "<li class='td td-item'>" + "<div class='item-pic'>" + "<a href = '#' class='J_MakePoint'>" + $"<img src = 'images/{pic}' class='itempic J_ItemImg' >" + "</a>" + "</div>" + "<div class='item-info'>" + "<div class='item-basic-info'>" + $"<a href = 'ProductDetails.aspx?id={Row1["id"]}' >" + "<p>" + $"{Row1["name"]}" + "</p>" + "</a>" + "</div>" + "</div>" + "</li>" + "<li class='td td-price'>" + "<div class='item-price'>" + $"{Row1["ProPrice"]}" + "</div>" + "</li>" + "<li class='td td-number'>" + "<div class='item-number'>" + "<span>" + "×" + "</span>" + $"{Row1["num"]}" + "</div>" + "</li>" + "<li class='td td-operation'>" + "<div class='item-operation'>" + "</div>" + "</li>" + "</ul>"; } AllOrder.InnerHtml += "</div>" + "<div class='order-right'>" + "<li class='td td-amount'>" + "<div class='item-amount'>" + $"¥{result}" + //"<p>" + "含运费:" + "<span>" + "10.00" + "</span>" + "</p>" + "</div>" + "</li>" + "<div class='move-right'>" + "<li class='td td-status'>" + "<div class='item-status'>" + //"<p class='order-info'>" + "<a href = 'orderinfo.html' >" + "订单详情" + "</a>" + "</p>" + //"<p class='order-info'>" + "<a href = 'logistics.html' >" + "查看物流" + "</a>" + "</p>" + "</div >" + "</li>" + // "<li class='td td-change'>" + // $"<button class='am-btn am-btn-danger anniu' name='DelOrder' data-uid='{Session["uname"]}' data-onum='{Row["orderNum"]}'>" + // "删除订单" + "</button>" + //"</li>" + "</div>" + "</div>" + "</div>" + "</div>"; } } }