Пример #1
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            p_login f = new p_login();

            f.Show();
            this.Hide();
        }
Пример #2
0
        private void btn_login_p_Click(object sender, EventArgs e)
        {
            this.Hide();
            p_login f = new p_login();

            f.Show();
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            con.Open();
            SqlCommand cmd = new SqlCommand(" select * from passenger where username = '******'", con);

            //  cmd.CommandType = CommandType.Text;

            SqlDataReader Rd = cmd.ExecuteReader();

            bool found_username = false;

            while (Rd.Read())
            {
                found_username = true;
            }
            Rd.Close();
            cmd = new SqlCommand(" select * from passenger where passport = '" + txt_passport_num.Text + "'", con);

            Rd = cmd.ExecuteReader();

            bool found_passport = false;

            while (Rd.Read())
            {
                found_passport = true;
            }
            Rd.Close();

            if (txt_con_pass.Text != txt_pass.Text)
            {
                MessageBox.Show("incorrect password !", "an error occured", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else if (txt_name.Text == "" || txt_pass.Text == "" || txt_name.Text == "" || txt_con_pass.Text == "" || txt_passport_num.Text == "" || txt_gmail.Text == "" || txt_gmail_pass.Text == "")
            {
                MessageBox.Show("  Please Enter Full Information  ");
            }
            else if (found_username)
            {
                MessageBox.Show("this username is already exist try another username");
            }
            else if (found_passport)
            {
                MessageBox.Show("this passport is already exist");
            }
            else
            {
                cmd = new SqlCommand(" exec p_signup '" + txt_username.Text + "' ,'" + txt_pass.Text + "','" + txt_name.Text + "','" + txt_passport_num.Text + "','" + txt_gmail.Text + "','" + txt_gmail_pass.Text + "'", con);
                cmd.ExecuteNonQuery();
                // cmd.CommandType = CommandType.StoredProcedure;
                MessageBox.Show("Done ");
                p_login f = new p_login();
                f.Show();
                this.Hide();
            }
            con.Close();
        }