public void DeleteClientAfterID(int index) { var context = new libraryEntities(); var person = context.Kliencis.Where(e => e.IDKlienta == index).FirstOrDefault(); context.Kliencis.Remove(person); context.SaveChanges(); }
public string AddClientToDatabase(Klienci client) { var context = new libraryEntities(); context.Kliencis.Add(client); context.SaveChanges(); return("Dodano Klienta"); }
public void ModifyClient(Klienci client) { var context = new libraryEntities(); var person = context.Kliencis.Find(client.IDKlienta); person.Imie = client.Imie; person.Nazwisko = client.Nazwisko; person.Plec = client.Plec; person.Wiek = client.Wiek; person.Email = client.Email; person.Telefon = client.Telefon; context.SaveChanges(); }