public IActionResult Index() { JezdecModel model = new JezdecModel(); model.jezdci = JezdecTable.Select(); return(View(model)); }
private void button1_Click(object sender, EventArgs e) { int id; if (int.TryParse(textID.Text, out id)) { Staj staj = StajTable.Select(id); if (staj.heslo == textHeslo.Text) { StajPrihlasen form = new StajPrihlasen(this, staj); form.Show(); this.Hide(); } else { errorProvider.SetError(textHeslo, "Špatné ID nebo heslo."); } } else if (textID.Text.Equals("Admin") && textHeslo.Text.Equals("AdminHeslo")) { AdminForm form = new AdminForm(this); form.Show(); this.Hide(); } else { Jezdec jezdec = JezdecTable.Select(textID.Text); if (jezdec == null) { errorProvider.SetError(textHeslo, "Špatné ID"); } if (jezdec.heslo == textHeslo.Text) { JezdecPrihlasen form = new JezdecPrihlasen(this, jezdec); form.Show(); this.Hide(); } else { errorProvider.SetError(textHeslo, "Špatné ID nebo heslo."); } } }