using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;
namespace Web.BuyOrder
{
public partial class AjaxDetail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bandDetail();
}
}
public void bandDetail()
{
string action = Request["action"].ToString();
string buyOderID = Request["BuyOrderID"].ToString();
DataTable dtBuyDetail = BLL.B_BuyOrderDetail.GetBuyDetailID(buyOderID).Tables[0];
StringBuilder sb = new StringBuilder();
sb.Append("<table><thead><tr><th width=/"80px/">商品编号</th><th width=/"80px/">商品名称</th><th width=/"80px/">供应商</th><th width=/"80px/">单价</th><th width=/"80px/">数量</th><th width=/"80px/">税额</th><th width=/"80px/">折扣额</th><th width=/"80px/">应收金额</th></tr>");
sb.Append("</thead><tbody>");
for(int i=0; i<dtBuyDetail.Rows.Count;i++)
{
string productID = Convert.ToString(dtBuyDetail.Rows[i]["ProductID"]);
string productName = Convert.ToString(dtBuyDetail.Rows[i]["ProductName"]);
string supplierName=Convert.ToString(dtBuyDetail.Rows[i]["SupplierName"]);
decimal price = Convert.ToDecimal(dtBuyDetail.Rows[i]["TotalPrice"]);
int Quantity = Convert.ToInt32(dtBuyDetail.Rows[i]["Quantity"]);
decimal taxReta = Convert.ToDecimal(dtBuyDetail.Rows[i]["税额"]);
decimal desCountReta = Convert.ToDecimal(dtBuyDetail.Rows[i]["折扣额"]);
decimal totalMoney = Convert.ToDecimal(dtBuyDetail.Rows[i]["金额"]);
sb.Append("<tr><td>"+productID+"</td>");
sb.Append("<td>" + productName + "</td>");
sb.Append("<td>" + supplierName + "</td>");
sb.Append("<td>" + price+ "</td>");
sb.Append("<td>" + Quantity + "</td>");
sb.Append("<td>" + taxReta + "</td>");
sb.Append("<td>" +desCountReta + "</td>");
sb.Append("<td>" + totalMoney + "</td>");
sb.Append("</tr>");
}
sb.Append("</tbody></table>");
Response.Write(sb.ToString());
Response.End();
}
}
}
添加表(后台代码)
最新推荐文章于 2022-11-07 19:58:21 发布
本文介绍了一个使用ASP.NET处理页面请求的方法,通过从请求中获取订单ID并调用业务逻辑层(BLL)来获取订单详情,然后将这些信息构建成HTML表格进行显示。此过程涉及数据检索、类型转换及字符串拼接等步骤。
9624

被折叠的 条评论
为什么被折叠?



