public void Vytvor(int id) { List <object> attributes = ZakaznikGateway.Select(id); Idu = id; Login = attributes[1].ToString(); Email = attributes[2].ToString(); Heslo = attributes[3].ToString(); Krestni = attributes[4].ToString(); Prijmeni = attributes[5].ToString(); Ulice = attributes[6].ToString(); Mesto = attributes[7].ToString(); Psc = attributes[8].ToString(); Tel = attributes[9].ToString(); }
public Form3(bool zakaznik) { InitializeComponent(); boo = zakaznik; if (boo) { zakaznici = new List <Zakaznik>(); foreach (List <object> attributes in ZakaznikGateway.Select()) { Zakaznik polozka = new Zakaznik(); polozka.Vytvor(attributes); zakaznici.Add(polozka); } if (zakaznici.Count == 0) { label1.Text = "Zadny zakaznik"; label2.Hide(); label3.Hide(); label4.Hide(); label5.Hide(); label6.Hide(); label7.Hide(); label8.Hide(); label9.Hide(); label10.Hide(); button1.Hide(); button2.Hide(); } else { max = zakaznici.Count; SetText(); } } else { objednavky = new List <Objednavka>(); foreach (List <object> attributes in ObjednavkaGateway.SelectAll()) { Objednavka polozka = new Objednavka(); polozka.Vytvor(attributes); objednavky.Add(polozka); } if (objednavky.Count == 0) { label1.Text = "Zadna objednavka"; label2.Hide(); label3.Hide(); label4.Hide(); label5.Hide(); label6.Hide(); label7.Hide(); label8.Hide(); label9.Hide(); label10.Hide(); button1.Hide(); button2.Hide(); } else { max = objednavky.Count; SetText(); } } }