Ejemplo n.º 1
0
 public static List <DAL.Passwort> LesenFremdschluesselGleich(DAL.Kategorie suchschluessel)
 {
     using (var context = new DAL.Context())
     {
         return((from record in context.Passwort.Include("Kategorie") where record.Kategorie.KategorieId == suchschluessel.KategorieId select record).ToList());
     }
 }
Ejemplo n.º 2
0
 public static void Loeschen(DAL.Kategorie kategorie)
 {
     using (var context = new DAL.Context())
     {
         context.Kategorie.Remove(kategorie);
         context.SaveChanges();
     }
 }
Ejemplo n.º 3
0
 public static void Aktualisieren(DAL.Kategorie kategorie)
 {
     using (var context = new DAL.Context())
     {
         context.Entry(kategorie).State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
Ejemplo n.º 4
0
 public static void Loeschen(DAL.Kategorie kategorie)
 {
     using (var context = new DAL.Context())
     {
         var itemtoRemove = context.Kategorie.FirstOrDefault(k => k.KategorieId == kategorie.KategorieId);
         context.Kategorie.Remove(itemtoRemove);
         context.SaveChanges();
     }
 }
Ejemplo n.º 5
0
 public static Int64 Erstellen(DAL.Kategorie kategorie)
 {
     if (kategorie.Name == null || kategorie.Name == "")
     {
         kategorie.Name = "leer";
     }
     using (var context = new DAL.Context())
     {
         context.Kategorie.Add(kategorie);
         context.SaveChanges();
         return(kategorie.KategorieId);
     }
 }