Ejemplo n.º 1
0
        private void reg_send_Click(object sender, EventArgs e)
        {
            DBA db = DBA.Instance;

            db.connect();

            if (reg_id.Text != "" && reg_fname.Text != "" && reg_lname.Text != "" && reg_email.Text != "" && reg_password.Text != "")
            {
                if (GlobalItems.checkIdNumber(reg_id.Text))
                {
                    db.query("INSERT INTO users (fname, lname, email, password, idNUmber, type) VALUES ('" + reg_fname.Text + "', '" + reg_lname.Text + "', '" + reg_email.Text + "', '" + reg_password.Text + "', '" + reg_id.Text + "', 6)");

                    MessageBox.Show("Data is Saved, Please type your id number and password to login into system");

                    GlobalItems.slideLeftSize(this, 350);
                }
                else
                {
                    MessageBox.Show("User with this id number is already exist in system, please type another id");
                }
            }
            else
            {
                MessageBox.Show("All fields have to be filled");
            }
        }