OrderDetails.aspx

 

This screen is meant for viewing the order details of that particular customer.The order details can be tracked on by its Orderid. It gives the user the entire history of his purchase.

 

The source code for this file is

 

if(Session["fullname"]!=null)

                     {

                           lblCustomize.Text = "Welcome " + Session["fullname"].ToString() + " your order details are as follows";

                     }

 

                     int OrderID = Int32.Parse(Request.Params["OrderID"]);

 

                     // Get the customer ID too

                     string CustomerId = User.Identity.Name;

 

                     // Obtain Order Details from Database

                     prjstart.Components.FinalOrders orderHistory = new prjstart.Components.FinalOrders();

                     prjstart.Components.orderdetails myOrderDetails = orderHistory.GetOrderDetails(OrderID, CustomerId);// Gets the order details exeutes the procedure.

 

                     // if order was found, display it

                     if (myOrderDetails != null)

                     {

 

                           // Bind Items to GridControl

                           dgOrderDetails.DataSource = myOrderDetails.OrderItems;

                           dgOrderDetails.DataBind();

 

                           // Update labels with summary details

                           lblGrandTotal.Text = "Total Outlay was worth " + String.Format( "{0:c}", myOrderDetails.OrderTotal);

                           lblOrderNumber.Text = "Your Order Number is " + OrderID.ToString();

                           lblOrderDate.Text = "Date you ordered was " + myOrderDetails.OrderDate.ToShortDateString();

                           lblShippedDate.Text ="Order would be shipped on " +  myOrderDetails.ShipDate.ToShortDateString();

                     }

                           // otherwise display an error message

                     else

                     {

 

                           lblError.Text = "Order not found!";

                           lblGrandTotal.Visible = false;             // do not show the details if not  valid

                           lblCustomize.Visible = false;

                           lblOrderDate.Visible = false;

                           lblOrderName.Visible = false;

                           lblShippedDate.Visible = false;

                           dgOrderDetails.Visible = false;

                     }

 

 

Back to main page