Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Data.SqlClient;
- using QuanLyDiemHocSinhTHPT.DAO;
- namespace QuanLyDiemHocSinhTHPT
- {
- public partial class frmLogin : Form
- {
- public frmLogin()
- {
- InitializeComponent();
- }
- private void btDangNhap_Click(object sender, EventArgs e)
- {
- string userName = txtTenDangNhap.Text;
- string passWord = txtTenDangNhap.Text;
- if (Login(userName, passWord))
- {
- frmMain f = new frmMain();
- this.Hide();
- f.ShowDialog();
- this.Show();
- }
- else
- {
- MessageBox.Show("Sai tên tài khoản hoặc mật khẩu!");
- }
- }
- bool Login(string userName, string passWord)
- {
- return AccountDAO.Instance.Login(userName, passWord);
- }
- private void btThoat_Click(object sender, EventArgs e)
- {
- Application.Exit();
- }
- private void frmLogin_FormClosing(object sender, FormClosingEventArgs e)
- {
- if (MessageBox.Show("Bạn có thật sự muốn thoát chương trình?", "Thông báo", MessageBoxButtons.OKCancel) != System.Windows.Forms.DialogResult.OK)
- {
- e.Cancel = true;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement