GetOrderData() public method

public GetOrderData ( int orderId ) : DataTable
orderId int
return System.Data.DataTable
コード例 #1
0
ファイル: OrderDetail.aspx.cs プロジェクト: stone0090/dian
        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();
            }
        }
コード例 #2
0
ファイル: GetOrderData.ashx.cs プロジェクト: stone0090/dian
        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("{}");
            }
        }