예제 #1
0
        public void PopulateData()
        {
            int id = Int32.Parse(Session["id"].ToString());

            tableCart.DataSource = CartHandler.GetCarts(id);
            tableCart.DataBind();

            if (tableCart.DataSource != null)
            {
                grandTotalTxt.Text = CartHandler.GetGrandTotal(id).ToString();
            }
            else
            {
                grandTotalTxt.Text = "0";
            }
        }
예제 #2
0
        protected void CheckoutBtn(object sender, EventArgs e)
        {
            populatePaymentTable();
            tablePaymentType.Visible = true;
            Label2.Visible           = true;
            PaymentTypeId.Visible    = true;

            string paymentTypeId = PaymentTypeId.Text;
            int    userId        = Int32.Parse(Session["id"].ToString());

            Response response = CartController.CheckOut(CartHandler.GetCarts(userId), paymentTypeId, userId);

            if (response.successStatus == true)
            {
                Response.Redirect("~/views/Homeaspx.aspx");
            }
            else
            {
                lblErrortxt.Text = response.message;
            }
        }