public static NutritionOrderEN Convert(NutritionOrderDTO dto)
        {
            NutritionOrderEN newinstance = null;

            try
            {
                if (dto != null)
                {
                    newinstance = new NutritionOrderEN();



                    newinstance.Id          = dto.Id;
                    newinstance.Description = dto.Description;
                    newinstance.DietCode    = dto.DietCode;
                    if (dto.CareActivity_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.ICareActivityCAD careActivityCAD = new MoSIoTGenNHibernate.CAD.MosIoT.CareActivityCAD();

                        newinstance.CareActivity = careActivityCAD.ReadOIDDefault(dto.CareActivity_oid);
                    }
                    newinstance.Name = dto.Name;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newinstance);
        }
Ejemplo n.º 2
0
        public static MedicationEN Convert(MedicationDTO dto)
        {
            MedicationEN newinstance = null;

            try
            {
                if (dto != null)
                {
                    newinstance = new MedicationEN();



                    if (dto.CareActivity_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.ICareActivityCAD careActivityCAD = new MoSIoTGenNHibernate.CAD.MosIoT.CareActivityCAD();

                        newinstance.CareActivity = careActivityCAD.ReadOIDDefault(dto.CareActivity_oid);
                    }
                    newinstance.ProductReference = dto.ProductReference;
                    newinstance.Name             = dto.Name;
                    newinstance.Manufacturer     = dto.Manufacturer;
                    newinstance.Description      = dto.Description;
                    newinstance.Dosage           = dto.Dosage;
                    newinstance.Form             = dto.Form;
                    newinstance.MedicationCode   = dto.MedicationCode;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newinstance);
        }
        public static AppointmentEN Convert(AppointmentDTO dto)
        {
            AppointmentEN newinstance = null;

            try
            {
                if (dto != null)
                {
                    newinstance = new AppointmentEN();



                    newinstance.Id          = dto.Id;
                    newinstance.IsVirtual   = dto.IsVirtual;
                    newinstance.Description = dto.Description;
                    newinstance.Direction   = dto.Direction;
                    newinstance.ReasonCode  = dto.ReasonCode;
                    if (dto.CareActivity_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.ICareActivityCAD careActivityCAD = new MoSIoTGenNHibernate.CAD.MosIoT.CareActivityCAD();

                        newinstance.CareActivity = careActivityCAD.ReadOIDDefault(dto.CareActivity_oid);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newinstance);
        }
Ejemplo n.º 4
0
        public static ComunicationEN Convert(ComunicationDTO dto)
        {
            ComunicationEN newinstance = null;

            try
            {
                if (dto != null)
                {
                    newinstance = new ComunicationEN();



                    newinstance.Severity = dto.Severity;
                    newinstance.Message  = dto.Message;
                    newinstance.SendDate = dto.SendDate;
                    newinstance.Id       = dto.Id;
                    if (dto.EventTelemetry_oid != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IEventTelemetryCAD eventTelemetryCAD = new MoSIoTGenNHibernate.CAD.MosIoT.EventTelemetryCAD();

                        newinstance.EventTelemetry = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.EventTelemetryEN>();
                        foreach (int entry in dto.EventTelemetry_oid)
                        {
                            newinstance.EventTelemetry.Add(eventTelemetryCAD.ReadOIDDefault(entry));
                        }
                    }
                    if (dto.CareActivity_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.ICareActivityCAD careActivityCAD = new MoSIoTGenNHibernate.CAD.MosIoT.CareActivityCAD();

                        newinstance.CareActivity = careActivityCAD.ReadOIDDefault(dto.CareActivity_oid);
                    }
                    if (dto.CarePlanTemplate_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.ICarePlanTemplateCAD carePlanTemplateCAD = new MoSIoTGenNHibernate.CAD.MosIoT.CarePlanTemplateCAD();

                        newinstance.CarePlanTemplate = carePlanTemplateCAD.ReadOIDDefault(dto.CarePlanTemplate_oid);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newinstance);
        }
        public static IMCareActivityEN Convert(IMCareActivityDTO dto)
        {
            IMCareActivityEN newinstance = null;

            try
            {
                if (dto != null)
                {
                    newinstance = new IMCareActivityEN();



                    if (dto.CareActivity_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.ICareActivityCAD careActivityCAD = new MoSIoTGenNHibernate.CAD.MosIoT.CareActivityCAD();

                        newinstance.CareActivity = careActivityCAD.ReadOIDDefault(dto.CareActivity_oid);
                    }
                    newinstance.Id   = dto.Id;
                    newinstance.Name = dto.Name;
                    if (dto.OriginAssociation_oid != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IAssociationCAD associationCAD = new MoSIoTGenNHibernate.CAD.MosIoT.AssociationCAD();

                        newinstance.OriginAssociation = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.AssociationEN>();
                        foreach (int entry in dto.OriginAssociation_oid)
                        {
                            newinstance.OriginAssociation.Add(associationCAD.ReadOIDDefault(entry));
                        }
                    }
                    if (dto.TargetAssociation_oid != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IAssociationCAD associationCAD = new MoSIoTGenNHibernate.CAD.MosIoT.AssociationCAD();

                        newinstance.TargetAssociation = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.AssociationEN>();
                        foreach (int entry in dto.TargetAssociation_oid)
                        {
                            newinstance.TargetAssociation.Add(associationCAD.ReadOIDDefault(entry));
                        }
                    }
                    if (dto.Scenario_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IIoTScenarioCAD ioTScenarioCAD = new MoSIoTGenNHibernate.CAD.MosIoT.IoTScenarioCAD();

                        newinstance.Scenario = ioTScenarioCAD.ReadOIDDefault(dto.Scenario_oid);
                    }
                    newinstance.Description = dto.Description;

                    if (dto.Operations != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IEntityOperationCAD entityOperationCAD = new MoSIoTGenNHibernate.CAD.MosIoT.EntityOperationCAD();

                        newinstance.Operations = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.EntityOperationEN>();
                        foreach (EntityOperationDTO entry in dto.Operations)
                        {
                            newinstance.Operations.Add(EntityOperationAssemblerDTO.Convert(entry));
                        }
                    }

                    if (dto.Attributes != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IEntityAttributesCAD entityAttributesCAD = new MoSIoTGenNHibernate.CAD.MosIoT.EntityAttributesCAD();

                        newinstance.Attributes = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.EntityAttributesEN>();
                        foreach (EntityAttributesDTO entry in dto.Attributes)
                        {
                            newinstance.Attributes.Add(EntityAttributesAssemblerDTO.Convert(entry));
                        }
                    }

                    if (dto.States != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IEntityStateCAD entityStateCAD = new MoSIoTGenNHibernate.CAD.MosIoT.EntityStateCAD();

                        newinstance.States = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.EntityStateEN>();
                        foreach (EntityStateDTO entry in dto.States)
                        {
                            newinstance.States.Add(EntityStateAssemblerDTO.Convert(entry));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newinstance);
        }