private void btnGirisYap_Click(object sender, EventArgs e) { User currentUser = _userController.GetLogin(txtKullaniciAdi.Text, txtSifre.Text); if (currentUser != null) { if (currentUser.UserRole == UserRole.Standard) { frmMain frm = new frmMain(currentUser); frm.Owner = this; frm.Show(); this.Hide(); } else { frmAdmin frm = new frmAdmin(); frm.Owner = this; frm.Show(); this.Hide(); } } else { MessageBox.Show("Hatali giriş bilgileri"); } }
private void BtnLogin_Click(object sender, EventArgs e) { _userController = new UserController(); User currentUser = _userController.GetByLogin(txtUsername.Text, txtPassword.Text); if (currentUser != null) { if (currentUser.UserRole == UserRole.Standart) { frmMain frm = new frmMain(currentUser); //frm main ctorunda user göndericez frm.Owner = this; frm.Show(); this.Hide(); } else { frmAdmin admin = new frmAdmin(); admin.Owner = this; admin.Show(); this.Hide(); } } else { MessageBox.Show("Böyle bir kullanıcı yok, kayıt olabilirsiniz."); } }
private void btnLogin_Click(object sender, EventArgs e) { User currentUser = _userController.GetByLogin(txtUserName.Text, txtPassword.Text); if (currentUser != null) { if (currentUser.UserRole == UserRole.Standart) { frmMain frm = new frmMain(currentUser); frm.Owner = this; frm.Show(); this.Hide(); } else { frmAdmin frm = new frmAdmin(); frm.Owner = this; frm.Show(); this.Hide(); } } else { MessageBox.Show("Kullanıcı bulunamadı"); } }