コード例 #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            String uName = userName.Text.ToString();
            String uPwd  = userPassword.Text.ToString();

            clsdb obj = new clsdb();

            DataTable dt = new DataTable();


            dt = obj.getUserTable(uName, uPwd);

            if (dt.Rows.Count > 0 && dt.Rows[0][3].ToString() == "su_admin")
            {
                Addpatients frm = new Addpatients();

                frm.Show();

                this.Hide();
            }

            else if (dt.Rows.Count > 0 && dt.Rows[0][3].ToString() == "staff")
            {
                Addpatients frm = new Addpatients();
                frm.Show();
            }

            else
            {
                MessageBox.Show("Username or password is incorrect!");
            }
        }
コード例 #2
0
ファイル: staff.cs プロジェクト: SemicolonCG/crudApplication
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            Addpatients frmp = new Addpatients();

            frmp.Show();
            this.Close();
        }