public static IMCommunicationDTOA Convert(EntityEN en, NHibernate.ISession session = null) { IMCommunicationDTOA dto = null; IMCommunicationRESTCAD iMCommunicationRESTCAD = null; IMCommunicationCEN iMCommunicationCEN = null; IMCommunicationCP iMCommunicationCP = null; if (en != null) { dto = new IMCommunicationDTOA(); iMCommunicationRESTCAD = new IMCommunicationRESTCAD(session); iMCommunicationCEN = new IMCommunicationCEN(iMCommunicationRESTCAD); iMCommunicationCP = new IMCommunicationCP(session); IMCommunicationEN enHijo = iMCommunicationRESTCAD.ReadOIDDefault(en.Id); // // Attributes dto.Id = en.Id; dto.Name = en.Name; dto.Description = en.Description; // // TravesalLink /* Rol: IMCommunication o--> Comunication */ dto.ValueCommunication = ComunicationAssembler.Convert((ComunicationEN)enHijo.Comunication, session); // // Service } return(dto); }
public static CareActivityDTOA Convert(CareActivityEN en, NHibernate.ISession session = null) { CareActivityDTOA dto = null; CareActivityRESTCAD careActivityRESTCAD = null; CareActivityCEN careActivityCEN = null; CareActivityCP careActivityCP = null; if (en != null) { dto = new CareActivityDTOA(); careActivityRESTCAD = new CareActivityRESTCAD(session); careActivityCEN = new CareActivityCEN(careActivityRESTCAD); careActivityCP = new CareActivityCP(session); // // Attributes dto.Id = en.Id; dto.Name = en.Name; dto.Description = en.Description; dto.Periodicity = en.Periodicity; dto.Duration = en.Duration; dto.Location = en.Location; dto.OutcomeCode = en.OutcomeCode; dto.TypeActivity = en.TypeActivity; dto.ActivityCode = en.ActivityCode; // // TravesalLink /* Rol: CareActivity o--> Comunication */ dto.Comunications = null; List <ComunicationEN> Comunications = careActivityRESTCAD.Comunications(en.Id).ToList(); if (Comunications != null) { dto.Comunications = new List <ComunicationDTOA>(); foreach (ComunicationEN entry in Comunications) { dto.Comunications.Add(ComunicationAssembler.Convert(entry, session)); } } /* Rol: CareActivity o--> Appointment */ dto.Appointments = null; List <AppointmentEN> Appointments = careActivityRESTCAD.Appointments(en.Id).ToList(); if (Appointments != null) { dto.Appointments = new List <AppointmentDTOA>(); foreach (AppointmentEN entry in Appointments) { dto.Appointments.Add(AppointmentAssembler.Convert(entry, session)); } } /* Rol: CareActivity o--> Medication */ dto.Medications = MedicationAssembler.Convert((MedicationEN)en.Medication, session); /* Rol: CareActivity o--> NutritionOrder */ dto.NutritionOrders = NutritionOrderAssembler.Convert((NutritionOrderEN)en.NutritionOrder, session); // // Service } return(dto); }