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 bool Registrace() { List <object> zakaznik = new List <object>(); Idu = 0; zakaznik.Add(Idu); zakaznik.Add(Login); zakaznik.Add(Email); zakaznik.Add(Heslo); zakaznik.Add(Krestni); zakaznik.Add(Prijmeni); zakaznik.Add(Ulice); zakaznik.Add(Mesto); zakaznik.Add(Psc); zakaznik.Add(Tel); ZakaznikGateway.Insert(zakaznik); return(true); }
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(); } } }
public static ZakaznikModel Detail(int idZakaznika) { return(new ZakaznikModel(ZakaznikGateway.Detail(idZakaznika))); }
public static int CountSluzby() { return(ZakaznikGateway.CountSluzby()); }
public static int InsertSluzba(int ids, string nazev, int cena, DateTime od, DateTime doo, string jmeno, string prijmeni) { return(ZakaznikGateway.InsertSluzba(ids, nazev, cena, od, doo, jmeno, prijmeni)); }
/* * * public static Collection<ZakaznikModel> SelectById(int idZ) * { * Collection<Zakaznik> zakaznici = ZakaznikGateway.Detail(idZ); * Collection<ZakaznikModel> ret = new Collection<ZakaznikModel>(); * foreach (var zakaznik in zakaznici) * { * ret.Add(new ZakaznikModel(zakaznik)); * } * return ret; * } */ public static int Insert(int idz, string jmeno, string prijmeni, DateTime datum_narozeni, int Tel_cislo, string email) { return(ZakaznikGateway.Insert(idz, jmeno, prijmeni, datum_narozeni, Tel_cislo, email)); }