private void Unos() { using (var db = new KaficDB()) { Kafic kafic = new Kafic { Ime = txtIme.Text, Adresa = txtAdresa.Text, Email = txtmail.Text, OIB = txtOib.Text, Telefon = txtTelefon.Text, IBAN = txtIBAN.Text }; db.Kafic.Add(kafic); db.SaveChanges(); } StaticVarijable.bazaPrazna = false; }
private void DohvatiKafic() { using (var db = new KaficDB()) { var upit = from k in db.Kafic select k; foreach (var k in upit.ToList <Kafic>()) { txtIme.Text = k.Ime; txtOib.Text = k.OIB; txtAdresa.Text = k.Adresa; txtmail.Text = k.Email; txtTelefon.Text = k.Telefon; txtIBAN.Text = k.IBAN; kafic = k; } } }
public frmKafic() { InitializeComponent(); kafic = new Kafic(); }