private void btnZaposleni_Click(object sender, EventArgs e) { //sakrivanje glavnog dashbord-a panelMeniDashboard.Visible = false; //Klasa koja se prikazuje u DGV RadnikIspis pom = new RadnikIspis(); FilterProperty = new RadnikIspis(); //Pomocna klasa za Input formu preko koje se rade sve CRUD funkcije PropertyRadnik pomInput = new PropertyRadnik(); myForm = pomInput; //Sakrivanje i prikazivanje dugmica i prikaza za zadatu tabelu panelPanelZaGV.Visible = true; bDelete.Visible = true; //panelCentar.Visible = true; panelSaTabelom.Visible = true; btnIzdaj.Visible = false; btnCijena.Visible = false; //Filter popunjavanje PopulateGrid(pom); PopuniFilterPanel(); BgColor(panelZaposleni); }
private void Login() { if (tbUserName.Text == "" || tbPassword.Text == "") { //MessageBox.Show("Molim vas unesite sve potrebne podatke!"); DialogResult dr = MetroMessageBox.Show(this, "\n\nMolimo Vas unesite sve potrebne podatke!", "Molimo Vas unesite sve potrebne podatke!", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DataTable dt = new DataTable(); PropertyRadnik myProperty = new PropertyRadnik(); SqlDataReader reader = SqlHelper.ExecuteReader(SqlHelper.GetConnectionString(), CommandType.Text, myProperty.GetSelectQuery()); dt.Load(reader); reader.Close(); var type = myProperty.GetType(); var properties = type.GetProperties(); for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i][7].ToString() == tbPassword.Text && dt.Rows[i][8].ToString() == tbUserName.Text) { string rola = dt.Rows[i][9].ToString(); //MessageBox.Show("Uspjesan Login"); //AutoClosingMessageBox.Show("Uspjesan Login", "LogIn", 1000); string mail = tbUserName.Text; string ID = dt.Rows[i][0].ToString(); Dashboard pom = new Dashboard(mail, ID, rola); pom.ShowDialog(); Visible = false; if (pom.DialogResult == DialogResult.Cancel) { pom.Close(); Visible = true; tbUserName.Text = ""; tbPassword.Text = ""; } break; } else if (i == dt.Rows.Count - 1) { //MessageBox.Show("Pogresan E-mail ili loznika!"); DialogResult dr = MetroMessageBox.Show(this, "\n\nPogresan E-mail ili loznika!", "Pogresan E-mail ili loznika!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }