Exemple #1
0
        private void Button1_Click_1(object sender, EventArgs e)
        {
            this.Hide();
            frmSetup form = new frmSetup();

            form.Show();
        }
Exemple #2
0
        private void BtnExit_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmSetup form = new frmSetup();

            form.Show();
        }
        private void BtnBackUserCreation_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmSetup form = new frmSetup();

            form.Show();
        }
        private void Button1_Click_1(object sender, EventArgs e)
        {
            if (txtNameUserCreation.Text == string.Empty)
            {
                MessageBox.Show("Please, type a name!", "System message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (txtEmailUserCreation.Text == string.Empty)
            {
                MessageBox.Show("Please, type an email!", "System message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (txtPasswordUserCreation.Text == string.Empty)
            {
                MessageBox.Show("Please, type a password!", "System message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (cmbUserTypeCreation.Text == string.Empty)
            {
                MessageBox.Show("Please, select a user type!", "System message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            SqlConnection sqlcon = new SqlConnection(@"Data Source=NOTE-ASUS\SQLEXPRESS;Initial Catalog=PBCS;User ID=josivan;Password=josivan");

            sqlcon.Open();
            SqlCommand cmd = sqlcon.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "Insert into PBCS.Users values ('" + txtNameUserCreation.Text + "','" + txtPasswordUserCreation.Text + "','" + txtEmailUserCreation.Text + "','" + cmbUserTypeCreation.SelectedValue + "')";
            cmd.ExecuteNonQuery();
            sqlcon.Close();

            txtNameUserCreation.Clear();
            txtEmailUserCreation.Clear();
            txtPasswordUserCreation.Clear();
            cmbUserTypeCreation.SelectedIndex = -1;

            MessageBox.Show("User created successfully", "System message", MessageBoxButtons.OK, MessageBoxIcon.Information);

            this.Hide();
            frmSetup form = new frmSetup();

            form.Show();
        }
        private void Button5_Click_3(object sender, EventArgs e)
        {
            frmSetup form = new frmSetup();

            form.Show();
        }