Exemple #1
0
        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();
        }
Exemple #2
0
        public string AddClientToDatabase(Klienci client)
        {
            var context = new libraryEntities();

            context.Kliencis.Add(client);
            context.SaveChanges();

            return("Dodano Klienta");
        }
Exemple #3
0
        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();
        }