Esempio n. 1
0
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            this.Hide();
            NurseMenu menu = new NurseMenu();

            menu.ShowDialog();
            this.Close();
        }
Esempio n. 2
0
        private void exitPictureBox_Click(object sender, EventArgs e)
        {
            this.Hide();
            NurseMenu search = new NurseMenu();

            search.ShowDialog();
            this.Close();
        }
        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Hide();
            NurseMenu mute = new NurseMenu();

            mute.ShowDialog();
            this.Close();
        }
Esempio n. 4
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            MSLoginDatabase database = new MSLoginDatabase();

            String s_loginid  = IdNumberTextBox.Text;
            String s_password = PasswordTextBox.Text;

            DataTable table = new DataTable();

            MySqlDataAdapter adapter = new MySqlDataAdapter();

            MySqlCommand Command = new MySqlCommand("SELECT * FROM `nurse` WHERE `s_loginid` = @usn and `s_password` = @pass ", database.getConnection());

            Command.Parameters.Add("@usn", MySqlDbType.VarChar).Value  = s_loginid;
            Command.Parameters.Add("@pass", MySqlDbType.VarChar).Value = s_password;

            adapter.SelectCommand = Command;

            adapter.Fill(table);

            if (table.Rows.Count > 0)
            {
                passingtext = IdNumberTextBox.Text;
                this.Close();
                NurseMenu nurseMenu = new NurseMenu();
                nurseMenu.Show();
            }
            else
            {
                if (s_loginid.Trim().Equals(""))
                {
                    MessageBox.Show("Enter Your Username To Login", "Empty Username", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else if (s_password.Trim().Equals(""))
                {
                    MessageBox.Show("Enter Your Password To Login", "Empty Password", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show("Wrong Username Or Password", "Wrong Data", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }