Beispiel #1
0
        private void LogoutButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            LoginFrom lform = new LoginFrom();

            lform.Show();
        }
Beispiel #2
0
        private void SubmitButton_Click(object sender, EventArgs e)
        {
            String iuserid     = userid.Text;
            String ipassword   = password.Text;
            String iIdSerialNo = IdSerialNo.Text;
            String iemail      = email.Text;
            String iphone      = phone.Text;

            if (iuserid.Trim().Equals("") || ipassword.Trim().Equals("") || iIdSerialNo.Trim().Equals(""))
            {
                MessageBox.Show("Required Fields - Your ID + Password & iIdSerialNo", "Empty Fields", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                String insertClient = reg.insertRegister(iuserid, ipassword, iIdSerialNo, iemail, iphone);

                if (insertClient == "ok")
                {
                    this.Hide();
                    LoginFrom lform = new LoginFrom();
                    lform.Show();
                    MessageBox.Show("New Register Inserted Successfuly", "Add Register", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else if (insertClient == "no")
                {
                    MessageBox.Show("Error-Register", "Add Register", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    userid.Text     = "";
                    password.Text   = "";
                    IdSerialNo.Text = "";
                    email.Text      = "";
                    phone.Text      = "";
                    MessageBox.Show("You are not Authorized Student", "Register Authorized", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }