/// <summary> /// Methode: Löschen einer Reise /// </summary> /// <param name="reise"></param> public static void Loeschen(DB.Reise reise) { using (var db = new DB.M120Datenbank()) { db.Entry(reise).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } }
/// <summary> /// Methode: Löschen eines Landes /// </summary> /// <param name="land"></param> private static void Loeschen(DB.Kunde land) { using (var db = new DB.M120Datenbank()) { db.Entry(land).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } }
/// <summary> /// Methode: Bestehende Reise aktualisieren /// </summary> /// <param name="reise"></param> public static void Aktualisieren(DB.Reise reise) { using (var db = new DB.M120Datenbank()) { db.Entry(reise).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
public static void Loeschen(DB.Kunde Kunde) { using (var DB = new DB.M120Datenbank()) { DB.Entry(Kunde).State = System.Data.Entity.EntityState.Deleted; DB.SaveChanges(); } }
public static void Aktualisieren(DB.Kunde Kunde) { using (var DB = new DB.M120Datenbank()) { DB.Entry(Kunde).State = System.Data.Entity.EntityState.Modified; DB.SaveChanges(); } }
public static void Loeschen_Reise_Hotel(Int64 reiseID, Int64 hotelID) { using (var db = new DB.M120Datenbank()) { IQueryable <DB.Reise_Hotel> query = from rec in db.Reise_Hotel where rec.Reise == reiseID && rec.Hotel == hotelID select rec; foreach (DB.Reise_Hotel element in query) { db.Entry(element).State = System.Data.Entity.EntityState.Deleted; } db.SaveChanges(); } }
public static void Loeschen_Kunde_Reise(Int64 kundeID, Int64 reiseID) { using (var db = new DB.M120Datenbank()) { IQueryable <DB.Kunde_Reise> query = from rec in db.Kunde_Reise where rec.Kunde == kundeID && rec.Reise == reiseID select rec; foreach (DB.Kunde_Reise element in query) { db.Entry(element).State = System.Data.Entity.EntityState.Deleted; } db.SaveChanges(); } }
public static Int64 Erstellen_Reise_Hotel(Int64 reiseID, Int64 hotelID) { using (var db = new DB.M120Datenbank()) { DB.Reise_Hotel rec = new DB.Reise_Hotel(); rec.Reise = reiseID; rec.Hotel = hotelID; db.Reise_Hotel.Add(rec); db.SaveChanges(); db.Entry(rec).Reload(); return(rec.Reise_Hotel_ID); } }
public static Int64 Erstellen_Kunde_Reise(Int64 kundeID, Int64 reiseID) { using (var db = new DB.M120Datenbank()) { DB.Kunde_Reise rec = new DB.Kunde_Reise(); rec.Kunde = kundeID; rec.Reise = reiseID; db.Kunde_Reise.Add(rec); db.SaveChanges(); db.Entry(rec).Reload(); return(rec.Kunde_Reise_ID); } }
/// <summary> /// Methode: Neues Land erstellen /// </summary> /// <param name="land"></param> /// <returns></returns> public static Int64 Erstellen(DB.Land land) { if (land.Name == null) { land.Name = ""; } if (land.Kurzname == null) { land.Kurzname = ""; } using (var db = new DB.M120Datenbank()) { db.Land.Add(land); db.SaveChanges(); db.Entry(land).Reload(); return(land.LandID); } }
/// <summary> /// Methode: Neue Reise erstellen /// </summary> /// <param name="reise"></param> /// <returns></returns> public static Int64 Erstellen(DB.Reise reise) { if (reise.Start == null) { reise.Start = DateTime.Now; } if (reise.Ende == null) { reise.Ende = DateTime.Now; } if (reise.NameLeitung == null) { reise.NameLeitung = ""; } using (var db = new DB.M120Datenbank()) { db.Reise.Add(reise); db.SaveChanges(); db.Entry(reise).Reload(); return(reise.ReiseID); } }
/// <summary> /// Methode: Neues Hotel erstellen /// </summary> /// <param name="hotel"></param> /// <returns></returns> public static Int64 Erstellen(DB.Hotel hotel) { if (hotel.Name == null) { hotel.Name = ""; } if (hotel.Ort == null) { hotel.Ort = ""; } if (hotel.Land == 0) { hotel.Land = 192; } if (hotel.Manager == null) { hotel.Manager = ""; } if (hotel.Telefon == null) { hotel.Telefon = ""; } if (hotel.Email == null) { hotel.Email = ""; } if (hotel.Web == null) { hotel.Web = ""; } using (var db = new DB.M120Datenbank()) { db.Hotel.Add(hotel); db.SaveChanges(); db.Entry(hotel).Reload(); return(hotel.HotelID); } }
public static long Erstellen(DB.Kunde Kunde) { if (Kunde.Anrede == null) { Kunde.Anrede = ""; } if (Kunde.Email == null) { Kunde.Email = ""; } if (Kunde.Geburtsdatum == null) { Kunde.Geburtsdatum = DateTime.Today; } if (Kunde.Mobile == null) { Kunde.Mobile = ""; } if (Kunde.Name == null) { Kunde.Name = ""; } if (Kunde.NameZusatz == null) { Kunde.NameZusatz = ""; } if (Kunde.Ort == null) { Kunde.Ort = ""; } if (Kunde.PassNr == null) { Kunde.PassNr = ""; } if (Kunde.StrasseNr == null) { Kunde.StrasseNr = ""; } if (Kunde.Telefon == null) { Kunde.Telefon = ""; } if (Kunde.Vorname == null) { Kunde.Vorname = ""; } if (Kunde.Web == null) { Kunde.Web = ""; } if (Kunde.Nationalitaet == 0) { Kunde.Nationalitaet = 192; } using (var db = new DB.M120Datenbank()) { db.Kunde.Add(Kunde); db.SaveChanges(); db.Entry(Kunde).Reload(); return(Kunde.KundeID); } }