Esempio n. 1
0
 public Zdarzenie(int id, OpisStanu opisStanu, Wykaz wykaz, double ilosc, DateTime dataWypozyczenia)
 {
     Id               = id;
     Opisstanu        = opisStanu;
     Wykaz            = wykaz;
     Ilosc            = ilosc;
     DataWypozyczenia = dataWypozyczenia;
 }
Esempio n. 2
0
 public bool UsunCzytelnikaPoId(int id)
 {
     if (DataContext.Czytelnicy.Exists(x => x.Id == id))
     {
         Wykaz czytelnik = DataContext.Czytelnicy.First(x => x.Id == id);
         return(DataContext.Czytelnicy.Remove(czytelnik));
     }
     return(false);
 }
Esempio n. 3
0
 public void DodajCzytelnika(Wykaz czytelnik)
 {
     if (czytelnik != null)
     {
         DataContext.Czytelnicy.Add(czytelnik);
     }
     else
     {
         throw new ArgumentNullException();
     }
 }
Esempio n. 4
0
 public bool UaktualnijCzytelnikaNaId(int id, Wykaz nowyCzytelnik)
 {
     if (nowyCzytelnik != null)
     {
         if (DataContext.Czytelnicy.Exists(x => x.Id == id))
         {
             Wykaz czytelnik = DataContext.Czytelnicy.First(x => x.Id == id);
             czytelnik.Adres    = nowyCzytelnik.Adres;
             czytelnik.Telefon  = nowyCzytelnik.Telefon;
             czytelnik.Imie     = nowyCzytelnik.Imie;
             czytelnik.Nazwisko = nowyCzytelnik.Nazwisko;
             return(true);
         }
         return(false);
     }
     else
     {
         throw new ArgumentNullException();
     }
 }