Example #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtUName.Text == string.Empty)
            {
                MessageBox.Show("you must enter username");
                return;
            }
            if (txtUPass.Text == string.Empty)
            {
                MessageBox.Show("you must enter the password");
                return;
            }
            DataTable dt = CLASS_LOGIN.splogin(txtUName.Text, txtUPass.Text);

            if (dt.Rows.Count > 0)
            {
                FRM_MAIN.check       = true;
                FRM_MAIN.P_ID        = int.Parse(dt.Rows[0]["per_ID"].ToString());
                Program.USERFULLNAME = dt.Rows[0]["U_Full_Name"].ToString();
                this.Close();
            }
            else
            {
                MessageBox.Show("username or password is wrong");
            }
        }