예제 #1
0
 public static List <T> Rekordy <T>() where T : Encja
 {
     if (typeof(T) == typeof(Sklep))
     {
         return(Sklep.Rekordy().Cast <T>().ToList());
     }
     else if (typeof(T) == typeof(Kasjer))
     {
         return(Kasjer.Rekordy().Cast <T>().ToList());
     }
     else if (typeof(T) == typeof(Klient))
     {
         return(Klient.Rekordy().Cast <T>().ToList());
     }
     else if (typeof(T) == typeof(Logowanie))
     {
         return(Logowanie.Rekordy().Cast <T>().ToList());
     }
     else if (typeof(T) == typeof(Produkt))
     {
         return(Produkt.Rekordy().Cast <T>().ToList());
     }
     throw new Exception("Nie sprecyzowano typu");
 }