//#End Region
    protected void btnOrder_Click(object sender, System.EventArgs e)
    {
        clsCart = new clsAddToCart();
        if (Session["captcha"] != null)
        {
            if (Session["captcha"].ToString() != txtCode.Text)
            {
                lblMsg.Text = "Invalid Code";
                FillCapctha();
                txtCode.Text = "";
            }
            else
            {
                //place order
                if (clsCart.CheckIsCod())
                {
                    MaxCOD = (double)cls.ReturnScaler("Select_CODLimit");

                    if (clsCart.TotalPrice() > MaxCOD)
                    {
                        MsgBox("Cash On Delivery not available on your order, as it exceeds max limit of " + MaxCOD);
                        return;
                    }
                    else
                    {
                        //place order and insert into db
                        Session["PaySuccess"] = "1";
                        Session["PayMode"]    = "Cash On Delivery";
                        Response.Redirect("PaymentSuccess.aspx");
                    }
                }
                else
                {
                    MsgBox("Cash On Delivery not available on your order, as some of the products in cart not available on Cash On Delivery");
                    return;
                }
            }
        }
        else
        {
            FillCapctha();
        }
    }