public AdminManager()
 {
     InitializeComponent();
     this.FormBorderStyle = FormBorderStyle.FixedSingle;
     this.MaximizeBox     = false;
     this.dbFile          = new FileDb();
     dbFile.GetDataFromTableUserLogin(dataGridViewUser, "admin");
 }
Beispiel #2
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(txtUserName.Text))
     {
         if (!string.IsNullOrWhiteSpace(txtPass.Text))
         {
             var fileDb = new FileDb();
             this.User = fileDb.GetUser(txtUserName.Text, txtPass.Text);
             if (this.User.Emperty)
             {
                 MessageBox.Show("Đăng nhập không thành công.Vui lòng kiểm tra lại thông tin tài khoản", "Cảnh báo", MessageBoxButtons.OK);
             }
             else
             {
                 MessageBox.Show("Đăng nhập thành công", "Thông báo", MessageBoxButtons.OK);
                 this.Close();
             }
         }
     }
 }