Ejemplo n.º 1
0
        private void button7_Click(object sender, EventArgs e)
        {
            this.Hide();
            LOGIN ss = new LOGIN();

            ss.Show();
        }
Ejemplo n.º 2
0
        private void button5_Click(object sender, EventArgs e)
        {
            this.Hide();
            LOGIN lg = new LOGIN();

            lg.Show();
        }
Ejemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (txtUsername.Text == "" || txtPassword.Text == "")
            {
                MessageBox.Show("Please fill mandatory fields");
            }

            else if (txtPassword.Text != txtConfirmPassword.Text)
            {
                MessageBox.Show("Passwords do not match");
            }
            else
            {
                using (SqlConnection sqlCon = new SqlConnection(connectionString))
                {
                    sqlCon.Open();
                    SqlCommand sqlCmd = new SqlCommand("StaffAdd", sqlCon);

                    sqlCmd.CommandType = CommandType.StoredProcedure;
                    sqlCmd.Parameters.AddWithValue("@UserID", 0);
                    sqlCmd.Parameters.AddWithValue("@IDNumber", txtIDNumber.Text.Trim());
                    sqlCmd.Parameters.AddWithValue("@FirstName", txtFirstName.Text.Trim());
                    sqlCmd.Parameters.AddWithValue("@LastName", txtLastName.Text.Trim());
                    sqlCmd.Parameters.AddWithValue("@DesignationID", cbxDesignation.Text.Trim());
                    sqlCmd.Parameters.AddWithValue("@RegionID", cbxRegion.Text.Trim());
                    sqlCmd.Parameters.AddWithValue("@Username", txtUsername.Text.Trim());
                    sqlCmd.Parameters.AddWithValue("@Password", txtPassword.Text.Trim());
                    sqlCmd.ExecuteNonQuery();
                    MessageBox.Show("Registration is succsessfull");
                    Clear();
                    {
                        this.Hide();
                        LOGIN ss = new LOGIN();
                        ss.Show();
                    }
                }
            }
        }