public void Zan(int id, string zanitost) { nomera pac = dbnomera.nomera.Where(c => c.id == id).FirstOrDefault(); pac.id = id; pac.zanitost = zanitost; dbnomera.SubmitChanges(); }
public void Edit(int id, string nomer, int cena, string stavka, string tip, string zanitost, string mesta) { nomera pac = dbnomera.nomera.Where(c => c.id == id).FirstOrDefault(); pac.id = id; pac.nomer = nomer; pac.cena = cena; pac.tip = tip; pac.stavka = stavka; pac.zanitost = zanitost; pac.mesta = mesta; dbnomera.SubmitChanges(); }
public void ADD(string nomer, int cena, string stavka, string tip, string zanitost, string mesta) { nomera pac = new nomera(); pac.nomer = nomer; pac.cena = cena; pac.tip = tip; pac.stavka = stavka; pac.zanitost = zanitost; pac.mesta = mesta; dbnomera.nomera.InsertOnSubmit(pac); dbnomera.SubmitChanges(); }
public void Delete(int id) { nomera pac = dbnomera.nomera.Where(c => c.id == id).FirstOrDefault(); dbnomera.nomera.DeleteOnSubmit(pac); dbnomera.SubmitChanges(); var pac2 = dbvn.veshinomera.Where(c => c.idnomera == id); foreach (var i in pac2) { dbvn.veshinomera.DeleteOnSubmit(i); dbvn.SubmitChanges(); } }