Ejemplo n.º 1
0
        protected void btnLogOn_Click(object sender, EventArgs e)
        {
            string phone = DropPhone.Text + "-" + txtPone.Text;

            if ((!logic.IsexistsBL(txtUser.Text, txtPass.Text)) && (!logic.CheckCustomer(txtEmail.Text, phone)))
            {
                HttpCookie mCookie;

                if (CheckBox1.Checked)
                {
                    mCookie             = new HttpCookie("userInfo");
                    mCookie["userName"] = txtUser.Text;
                    mCookie["Pass"]     = txtPass.Text;
                    mCookie.Expires     = DateTime.Now.AddHours(6);
                    Response.Cookies.Add(mCookie);
                    RegisterInData();
                    Response.Redirect("~/Pages/Buy.aspx");
                }
                else
                {
                    RegisterInData();
                    Response.Redirect("~/Pages/Buy.aspx");
                }
            }
            else
            {
                lblMaseg.Text      = " the name or password has already been reached, please click again";
                lblMaseg.ForeColor = Color.Red;
            }
        }
Ejemplo n.º 2
0
        protected void btnLgin_Click(object sender, EventArgs e)
        {
            HttpCookie mCookie;

            if (IsValid)
            {
                bool isExisets = logic.IsexistsBL(txtUsername.Text, txtPASS.Text);

                if ((CheckBoxRemmeber.Checked) && (isExisets))
                {
                    mCookie             = new HttpCookie("userInfo");
                    mCookie["userName"] = txtUsername.Text;
                    mCookie["Pass"]     = txtPASS.Text;
                    mCookie.Expires     = DateTime.Now.AddHours(6);
                    Response.Cookies.Add(mCookie);
                    Response.Redirect("Buy.aspx");
                }
                else
                {
                    if (isExisets)
                    {
                        Response.Redirect("Buy.aspx");
                    }



                    else
                    {
                        txtUsername.Text         = "";
                        linkToRegister.Text      = "The name does not exist in the system yom must Register";
                        linkToRegister.ForeColor = Color.Red;
                        linkToRegister.BackColor = Color.Yellow;
                    }
                }
            }
        }