Beispiel #1
0
        protected void CheckOut_Button_Click(object sender, EventArgs e)
        {
            //Check_Out_Message.Visible = false;
            Checkout_Message_PlaceHolder.Visible = false;
            if (Cart_Details_Repeater.Items.Count != 0)
            {
                MySqlConnection dbconn = new MySqlConnection(CommonClass.connectionstring);
                dbconn.Open();
                if (ClaimsPrincipal.Current.Identity.IsAuthenticated == false)
                {
                    dbconn.Close();
                    Response.Redirect("~/Account/Login.aspx");
                }
                else
                {
                    UserModel lUserModel;
                    lUserModel = CommonClass.Get_External_User_Profile(dbconn);
                    bool lRedirect = false;
                    if (lUserModel.Email_Address_Validated == 0 || lUserModel.Mobile_Validated == 0)
                    {
                        lRedirect = true;
                    }
                    if (lRedirect)
                    {
                        dbconn.Close();
                        Response.Redirect("~/Account/Validate.aspx");
                    }
                }
                foreach (RepeaterItem lRepeaterItem in Cart_Details_Repeater.Items)
                {
                    ShoppingCartClass.Update_Shopping_Cart(dbconn,
                                                           int.Parse((lRepeaterItem.FindControl("PRODUCT_ID") as HiddenField).Value),
                                                           double.Parse((lRepeaterItem.FindControl("MEASUREMENT_UNIT") as HiddenField).Value),
                                                           int.Parse((lRepeaterItem.FindControl("OLD_QUANTITY") as HiddenField).Value),
                                                           int.Parse((lRepeaterItem.FindControl("Quantity") as TextBox).Text),
                                                           double.Parse((lRepeaterItem.FindControl("PRICE") as HiddenField).Value));
                }


                AddressBook1.Load_Address(dbconn, true);
                dbconn.Close();
                Change_View("Personal_Info");
                MultiView1.SetActiveView(AddressBook_View);
            }
            else
            {
                Checkout_Message_PlaceHolder.Visible = true;
                //Check_Out_Message.Visible = true;
            }
        }
Beispiel #2
0
        protected void Update_Cart_Button_Click(object sender, EventArgs e)
        {
            MySqlConnection dbconn = new MySqlConnection(CommonClass.connectionstring);

            dbconn.Open();
            foreach (RepeaterItem lRepeaterItem in Cart_Details_Repeater.Items)
            {
                ShoppingCartClass.Update_Shopping_Cart(dbconn,
                                                       int.Parse((lRepeaterItem.FindControl("PRODUCT_ID") as HiddenField).Value),
                                                       double.Parse((lRepeaterItem.FindControl("MEASUREMENT_UNIT") as HiddenField).Value),
                                                       int.Parse((lRepeaterItem.FindControl("OLD_QUANTITY") as HiddenField).Value),
                                                       int.Parse((lRepeaterItem.FindControl("Quantity") as TextBox).Text),
                                                       double.Parse((lRepeaterItem.FindControl("PRICE") as HiddenField).Value));
            }

            dbconn.Close();
            Response.Redirect("~/View_Cart.aspx");
        }