public GetOrderData ( int orderId ) : |
||
orderId | int | |
리턴 |
private void BindTableData() { IOrder orderBiz = new OrderBiz(); var dt = orderBiz.GetOrderData(OrderId); if (dt != null && dt.Rows.Count > 0) { var data1 = dt.Clone(); var drs = dt.Select(" ( FINISH_TIME = '' or FINISH_TIME is null ) and ( CONFIRM_TIME = '' or CONFIRM_TIME is null ) "); foreach (DataRow row in drs) { data1.Rows.Add(row.ItemArray); } this.rUnconfirm.DataSource = data1; this.rUnconfirm.DataBind(); var data2 = dt.Clone(); drs = dt.Select("( FINISH_TIME = '' or FINISH_TIME is null ) and ( CONFIRM_TIME <> '' and CONFIRM_TIME is not null ) "); foreach (DataRow row in drs) { data2.Rows.Add(row.ItemArray); } this.rConfirm.DataSource = data2; this.rConfirm.DataBind(); var data3 = dt.Clone(); drs = dt.Select(" FINISH_TIME <> '' and FINISH_TIME is not null "); foreach (DataRow row in drs) { data3.Rows.Add(row.ItemArray); } this.rFinish.DataSource = data3; this.rFinish.DataBind(); decimal totalPrice = 0; foreach (DataRow row in dt.Rows) { totalPrice += base.ParseDecimal(row["PRICE"].ToString()) * base.ParseInt(row["COUNT"].ToString()); } this.sTotalPrice.InnerText = totalPrice.ToString(); } else { this.rUnconfirm.DataSource = null; this.rUnconfirm.DataBind(); this.rConfirm.DataSource = null; this.rConfirm.DataBind(); this.rFinish.DataSource = null; this.rFinish.DataBind(); } }
public void ProcessRequest(HttpContext context) { var orderId = Helper.ParseInt(context.Request.Form["oid"]); IOrder orderBiz = new OrderBiz(); var dt = orderBiz.GetOrderData(orderId); if (dt != null && dt.Rows.Count > 0) { var result = JsonHelper.DataTableToJson(dt); context.Response.Write(result); } else { context.Response.Write("{}"); } }