Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string        name  = textBox_name.Text;
            string        pwd   = textBox_pwd.Text;
            string        bdate = textBox_bd.Text;
            string        phone = textBox_pn.Text;
            string        email = textBox_em.Text;
            SqlConnection con   = new SqlConnection(constr);
            string        query = "insert into UserData values('" + name + "','" + pwd + "','" + bdate + "','" + phone + "','" + email + "');";
            SqlCommand    cmd   = new SqlCommand(query, con);

            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();
            MessageBox.Show("Sucessfully Added the User");
            textBox_name.Text = "";
            textBox_pwd.Text  = "";
            textBox_bd.Text   = "";
            textBox_pn.Text   = "";
            textBox_em.Text   = "";
            Ulogin u = new Ulogin();

            u.Show();
            Hide();
        }
Пример #2
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            if (radiobutton_user.Checked == true)
            {
                Ulogin u = new Ulogin();
                u.Show();
            }
            else if (radioButton2.Checked == true)
            {
                ALogin a = new ALogin();
                a.Show();
            }
            else
            {
                MessageBox.Show("Error");
            }

            Hide();
        }