private void loginButton_Click(object sender, EventArgs e) { Access accessObj = new Access(); accessObj.UserName = userNameTextBox.Text; accessObj.Password = passTextBox.Text; if (accessObj.UserName == "" || accessObj.Password == "") { MessageBox.Show("Give correct user name and password"); return; } AccessManager accMangObj = new AccessManager(); bool login = accMangObj.AccessInfo(accessObj); if (login == true) { userNameTextBox.Text = ""; passTextBox.Text = ""; HomePage homePage = new HomePage(); homePage.Show(); } else { userNameTextBox.Text = ""; passTextBox.Text = ""; MessageBox.Show("User name and password not found !\n Create account first."); return; } }