Beispiel #1
0
 public int CreateInteraction(Interaction shared)
 {
     DALayer.Entities.Interaction data = InteractionHandler.SharedToData(shared);
     ctx.Interaction.Add(data);
     ctx.SaveChanges();
     return(data.Id);
 }
Beispiel #2
0
        public List <Interaction> GetAllInteractionsByColonia(int coloniaId)
        {
            List <Interaction> ret = new List <Interaction>();

            ctx.Interaction.Where(c => c.requesterId == coloniaId).OrderByDescending(c => c.Fecha).ToList().ForEach((data) => {
                ret.Add(InteractionHandler.DataToShared(data));
            });
            return(ret);
        }
Beispiel #3
0
        public List <Interaction> GetAllInteractions()
        {
            List <Interaction> ret = new List <Interaction>();

            ctx.Interaction.ToList().ForEach((data) => {
                ret.Add(InteractionHandler.DataToShared(data));
            });
            return(ret);
        }
Beispiel #4
0
 public Interaction GetInteraction(int id)
 {
     DALayer.Entities.Interaction data = ctx.Interaction.Where(c => c.Id == id).First();
     if (data != null)
     {
         return(InteractionHandler.DataToShared(data));
     }
     else
     {
         return(null);
     }
 }
Beispiel #5
0
 public void UpdateInteraction(Interaction shared)
 {
     ctx.Interaction.Add(InteractionHandler.SharedToData(shared));
     ctx.SaveChanges();
 }