private void link_RfidLogin_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     MemberLoginWithRfid MemberLoginRfid = new MemberLoginWithRfid();
     this.Hide();
     MemberLoginRfid.ShowDialog();
     this.Close();
 }
        private void btn_SignUp_Click(object sender, EventArgs e)
        {
            lbl_ConFirmPassWrodValidation.Text = "";
            lbl_FirstnameValidation.Text = "";
            lbl_LastnameValidation.Text = "";
            lbl_RfidnumberValidation.Text = "";
            lbl_UsernameValidation.Text = "";
            lbl_PasswordValidation.Text = "";
            if (txt_Firstname.Text != "" && txt_Lastname.Text != "" && txt_Rfidnumber.Text != "" && txt_Username.Text != "" && txt_Password.Text != "" && txt_Password.Text == txt_ConfirmPassword.Text)
            {
                try
                {
                    connection.Open();
                    OleDbCommand command = new OleDbCommand();
                    command.Connection = connection;
                    command.CommandText = "insert into MemberData(firstname,lastname,rfid_number,username,pass) values('" + txt_Firstname.Text + "','" + txt_Lastname.Text + "','"+txt_Rfidnumber.Text+"','"+txt_Username.Text+"','"+txt_Password.Text+"') ";
                    command.ExecuteNonQuery();
                    connection.Close();
                    MessageBox.Show("Data Saved");
                    serialPort1.Close();
                    MemberLoginWithRfid MemberLoginWithRfid = new MemberLoginWithRfid();
                    this.Hide();
                    MemberLoginWithRfid.ShowDialog();
                    this.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                if (txt_Firstname.Text == "") lbl_FirstnameValidation.Text= "Firstname is required";
                if (txt_Lastname.Text == "") lbl_LastnameValidation.Text = "Lastname is required";
                if (txt_Rfidnumber.Text == "") lbl_RfidnumberValidation.Text = "Rfid Number is required";
                if (txt_Username.Text == "") lbl_UsernameValidation.Text = "Username is required";
                if (txt_Password.Text == "") lbl_PasswordValidation.Text = "Password is required";
                if (txt_ConfirmPassword.Text == "") lbl_ConFirmPassWrodValidation.Text = "Confirm Password is required";
                if (txt_ConfirmPassword.Text != txt_Password.Text) lbl_ConFirmPassWrodValidation.Text +="\n"+ "Confirm password isnt correct";

            }
        }
Ejemplo n.º 3
0
 private void btn_Member_Click(object sender, EventArgs e)
 {
     MemberLoginWithRfid mlf = new MemberLoginWithRfid();
     this.Hide();
     mlf.ShowDialog();
 }