Exemplo n.º 1
0
 private static Entity mapAdres(Contact item)
 {
     return(new Entity()
     {
         id = item.id,
         land = item.land,
         stad = item.stad,
         provincie = item.provincie,
         straat = item.straat,
         postcode = item.postcode,
         telefoonnummer = item.telefoonnummer,
         email = item.email,
         gebruikerid = item.gebruikerid,
         resortid = item.resortid
     });
 }
Exemplo n.º 2
0
        /// <summary>
        /// het update van de adres gegevens en of het toevoegen er van
        /// </summary>
        /// <param name="Adres"></param>
        /// <returns></returns>
        public int UpdateAdres(Contact contract)
        {
            Entity entity = map(contract);

            using (var context = new Connectie())
            {
                if (contract.id == 0)
                {
                    context.Adres.Add(entity);
                }
                else
                {
                    var query = from b in context.Adres
                                where b.id == contract.id
                                select b;

                    context.Entry(query.First()).CurrentValues.SetValues(entity);
                }
                context.SaveChanges();

                return(context.Adres.First().id);
            }
        }
Exemplo n.º 3
0
 private Entity map(Contact contact)
 {
     return(mapAdres(contact));
 }