public List <Contact> GetFaciliteit(Filter filter) { using (var connectie = new Connectie()) { var query = from item in connectie.Faciliteit select item; if (filter.id > 0) { query = from item in query where item.id == filter.id select item; } if (!String.IsNullOrEmpty(filter.faciliteit)) { query = from item in query where item.faciliteit == filter.faciliteit select item; } if (filter.resortid > 0) { query = from item in query where item.resortid == filter.resortid select item; } return(map(query)); } }
public List <Contact> GetDienst(Filter filter) { using (var connectie = new Connectie()) { var query = from item in connectie.Dienst select item; if (filter.id > 0) { query = from item in query where item.id == filter.id select item; } if (!String.IsNullOrEmpty(filter.dienst)) { query = from item in query where item.dienst == filter.dienst select item; } if (!String.IsNullOrEmpty(filter.zorg)) { query = from item in query where item.zorg == filter.zorg select item; } if (filter.resortid > 0) { query = from item in query where item.resortid == filter.resortid select item; } return(map(query)); } }
public List <Contact> GetPrijs(Filter filter) { using (var connectie = new Connectie()) { var query = from item in connectie.Prijs select item; if (filter.id > 0) { query = from item in query where item.id == filter.id select item; } if (filter.prijs > 0) { query = from item in query where item.prijs == filter.prijs select item; } if (filter.accomodatieid > 0) { query = from item in query where item.accomodatieid == filter.accomodatieid select item; } if (filter.dienstid > 0) { query = from item in query where item.dienstid == filter.dienstid select item; } return(map(query)); } }
public List <Contact> GetGebruiker(Filter filter) { using (var connectie = new Connectie()) { var query = from item in connectie.Gebruiker select item; if (filter.id > 0) { query = from item in query where item.id == filter.id select item; } if (!String.IsNullOrEmpty(filter.naam)) { query = from item in query where item.naam == filter.naam select item; } if (!String.IsNullOrEmpty(filter.achternaam)) { query = from item in query where item.achternaam == filter.achternaam select item; } if (filter.geboortedatum != null) { query = from item in query where item.geboortedatum == filter.geboortedatum select item; } return(map(query)); } }
public List <Contact> GetType(Filter filter) { using (var connectie = new Connectie()) { var query = from item in connectie.Type select item; if (filter.id > 0) { query = from item in query where item.id == filter.id select item; } if (filter.type > 0) { query = from item in query where item.type == filter.type select item; } if (!String.IsNullOrEmpty(filter.bio)) { query = from item in query where item.bio == filter.bio select item; } if (filter.resortid > 0) { query = from item in query where item.resortid == filter.resortid select item; } return(map(query)); } }
public List <Contact> GetResort(Filter filter) { using (var connectie = new Connectie()) { var query = from item in connectie.Resort select item; if (filter.id > 0) { query = from item in query where item.id == filter.id select item; } if (!String.IsNullOrEmpty(filter.naam)) { query = from item in query where item.naam == filter.naam select item; } if (!String.IsNullOrEmpty(filter.bio)) { query = from item in query where item.bio == filter.bio select item; } return(map(query)); } }
public List <Contact> GetReservatie(Filter filter) { using (var connectie = new Connectie()) { var query = from item in connectie.Reservatie select item; if (filter.id > 0) { query = from item in query where item.id == filter.id select item; } if (filter.datum != null) { query = from item in query where item.datum == filter.datum select item; } if (filter.start != null) { query = from item in query where item.start == filter.start select item; } if (filter.eind != null) { query = from item in query where item.eind == filter.eind select item; } if (filter.gebruikerid > 0) { query = from item in query where item.gebruikerid == filter.gebruikerid select item; } if (filter.resortid > 0) { query = from item in query where item.resortid == filter.resortid select item; } if (filter.accomodatieid > 0) { query = from item in query where item.accomodatieid == filter.accomodatieid select item; } if (filter.dienstid > 0) { query = from item in query where item.dienstid == filter.dienstid select item; } return(map(query)); } }
/// <summary> /// GetFaciliteit /// </summary> /// <param name="id"></param> /// <returns></returns> public Contact GetFaciliteitid(int id) { using (var context = new Connectie()) { var query = from b in context.Faciliteit where b.id == id orderby b.id select b; var resulaat = map(query); return(resulaat[0]); } }
/// <summary> /// DeleteFaciliteit /// </summary> /// <param name="id"></param> public void DeleteFaciliteit(int id) { using (var context = new Connectie()) { var query = (from b in context.Faciliteit where b.id == id select b).FirstOrDefault(); if (query != null) { context.Faciliteit.Remove(query); context.SaveChanges(); } } }
public List <Contact> GetUuid(Filter filter) { using (var connectie = new Connectie()) { var query = from item in connectie.Uuid select item; if (filter.id > 0) { query = from item in query where item.id == filter.id select item; } if (!String.IsNullOrEmpty(filter.uniqueidentifier)) { query = from item in query where item.uniqueidentifier == filter.uniqueidentifier select item; } return(map(query)); } }
public List <Contact> GetAccomodatie(Filter filter) { using (var connectie = new Connectie()) { var query = from item in connectie.Accomodatie select item; if (filter.id > 0) { query = from item in query where item.id == filter.id select item; } if (!String.IsNullOrEmpty(filter.oppervlakte)) { query = from item in query where item.oppervlakte == filter.oppervlakte select item; } if (filter.slaapkamers > 0) { query = from item in query where item.slaapkamers == filter.slaapkamers select item; } if (filter.autos > 0) { query = from item in query where item.autos == filter.autos select item; } if (filter.typeid > 0) { query = from item in query where item.typeid == filter.typeid select item; } return(map(query)); } }
/// <summary> /// het update van de faciliteit gegevens en of het toevoegen er van /// </summary> /// <param name="Faciliteit"></param> /// <returns></returns> public int UpdateFaciliteit(Contact contract) { Entity entity = map(contract); using (var context = new Connectie()) { if (contract.id == 0) { context.Faciliteit.Add(entity); } else { var query = from b in context.Faciliteit where b.id == contract.id select b; context.Entry(query.First()).CurrentValues.SetValues(entity); } context.SaveChanges(); return(context.Faciliteit.First().id); } }
public List <Contact> GetAdres(Filter filter) { using (var connectie = new Connectie()) { var query = from item in connectie.Adres select item; if (filter.id > 0) { query = from item in query where item.id == filter.id select item; } if (!String.IsNullOrEmpty(filter.land)) { query = from item in query where item.land == filter.land select item; } if (!String.IsNullOrEmpty(filter.stad)) { query = from item in query where item.stad == filter.stad select item; } if (!String.IsNullOrEmpty(filter.provincie)) { query = from item in query where item.provincie == filter.provincie select item; } if (!String.IsNullOrEmpty(filter.straat)) { query = from item in query where item.straat == filter.straat select item; } if (!String.IsNullOrEmpty(filter.postcode)) { query = from item in query where item.postcode == filter.postcode select item; } if (filter.telefoonnummer > 0) { query = from item in query where item.telefoonnummer == filter.telefoonnummer select item; } if (!String.IsNullOrEmpty(filter.email)) { query = from item in query where item.email == filter.email select item; } if (filter.gebruikerid > 0) { query = from item in query where item.gebruikerid == filter.gebruikerid select item; } if (filter.resortid > 0) { query = from item in query where item.resortid == filter.resortid select item; } return(map(query)); } }