Example #1
0
 private void viewCart(int id)
 {
     lblPayment.Visible = true;
     DropDownListPaymentType.Visible           = true;
     GridViewCart.FooterRow.Cells[0].Font.Bold = true;
     GridViewCart.FooterRow.Cells[0].Text      = "Grand Total";
     GridViewCart.FooterRow.Cells[6].Font.Bold = true;
     GridViewCart.FooterRow.Cells[6].Text      = ViewCartController.getGrandTotal(id).ToString();
     DropDownListPaymentType.DataSource        = ViewCartController.getPaymentType().Select(pt => pt.Type).ToList();
     DropDownListPaymentType.DataBind();
     btnCheckout.Visible = true;
 }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!ViewCartController.checkUserIsMember())
     {
         userWarnLbl.Text    = "You are not logged in as member to access this page";
         checkOutBtn.Visible = false;
         paymentDD.Visible   = false;
     }
     else
     {
         List <vCart> cart = load_data();
         if (cart.Count == 0)
         {
             cartEmptyLbl.Text   = "Empty Cart";
             checkOutBtn.Enabled = false;
             paymentDD.Enabled   = false;
         }
         load_payment();
         grandTotalLbl.Text = ViewCartController.getGrandTotal(Convert.ToInt32(Session["userID"]
                                                                               .ToString())).ToString();
     }
 }