private void btnLogin_Click(object sender, EventArgs e) { if (IsFormValid()) { DbSQLServer db = new DbSQLServer(AppSetting.ConnectionString()); bool isLoginDetailsCorrect = Convert.ToBoolean(db.GetScalarValue("sp_CheckLoginDetails", GetPrameters())); if (isLoginDetailsCorrect) { this.Hide(); frmDashboard frm = new frmDashboard(); frm.Show(); } else { MessageBox.Show("Netačno korisničko ime ili šifra.\nPokušajte opet.", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnSignIn_Click(object sender, EventArgs e) { if (IsFormValid()) { DbSQLServer dbSQLServer = new DbSQLServer(AppSetting.ConnectionString()); bool isLoginDetailsCorrect = Convert.ToBoolean(dbSQLServer.GetScalarValue("usp_UsersCheckLoginDetails", GetParameters())); if (isLoginDetailsCorrect) { GetLoggedInUserSettings(); this.Hide(); DashboardForm dashboardForm = new DashboardForm(); dashboardForm.Show(); } else { JIMessageBox.ShowErrorMessage("User Name/Password is incorrect"); //MessageBox.Show("User Name/Password is incorrect", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void GenerateEmployeeId() { DbSQLServer dBSQLSerevr = new DbSQLServer(AppSetting.ConnectionString()); EmployeeIDTextBox.Text = dBSQLSerevr.GetScalarValue("usp_EmployeesGenerateNewEmployeeId").ToString(); }