protected void btnPlaceOrder_Click(object sender, EventArgs e)
        {
            Transaction ts = new Transaction();
            try
            {
                ts.CustName = tbCustomerName.Text;
                ts.CustPhone = int.Parse(tbCustomerPhone.Text);
                ts.Email = tbCustomerEmail.Text;
                ts.Address = tbCustomerAddress.Text;
                ts.NoOfProducts = int.Parse(tbTotalProducts.Text);
                ts.TotalCost = int.Parse(tbTotalPrice.Text);
                ts.TransactionId = ts.AddNewTransaction();
            }
            catch { }
            for (int i = 0; i < dlCart.Items.Count; i++)
            {
                try
                {
                    DataListItem lst = dlCart.Items[i];
                    HiddenField hd = (HiddenField)lst.FindControl("hfProductID");
                    Label lblName = (Label)lst.FindControl("lblProductName");
                    TextBox tbNo = (TextBox)lst.FindControl("tbProductQuantity");
                    ts.ProductID = int.Parse(hd.Value);
                    ts.ProductName = lblName.Text;
                    ts.NoOfItems = int.Parse(tbNo.Text);
                    ts.SaveTransactionDetails();
                }
                catch
                {

                }
            }
            int transID = ts.TransactionId;
            OrderPlacedSuccessFully(transID);
        }
 public void LoadTransactionData(int TransactionID)
 {
     Transaction ts = new Transaction()
     {
         TransactionId = TransactionID
     };
     gvTransactionItems.DataSource = null;
     gvTransactionItems.DataSource = ts.GetTransactionInfo();
     gvTransactionItems.DataBind();
 }
 public void LoadCustomerData(int TransID)
 {
     Transaction ts = new Transaction()
     {
         TransactionId = TransID
     };
     rptrCustomer.DataSource = null;
     rptrCustomer.DataSource = ts.LoadCustData();
     rptrCustomer.DataBind();
 }
 public void LoadTransactions()
 {
     Transaction ts = new Transaction();
     DataTable dt = ts.GetAllTransactions();
     if (dt.Rows.Count > 0)
     {
         ddlTransID.DataTextField = "TransactionNo";
         ddlTransID.DataValueField = "TransactionNo";
         ddlTransID.DataSource = dt;
         ddlTransID.DataBind();
     }
 }