コード例 #1
0
        public static PackEN Convert(PackDTO dto)
        {
            PackEN newinstance = null;

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



                    newinstance.IdPack      = dto.IdPack;
                    newinstance.Nombre      = dto.Nombre;
                    newinstance.Familia     = dto.Familia;
                    newinstance.Descripción = dto.Descripción;
                    newinstance.Color       = dto.Color;
                    newinstance.Codigo      = dto.Codigo;
                    if (dto.Variable_oid != null)
                    {
                        PersonalHomeGenNHibernate.CAD.PersonalHome.IVariableCAD variableCAD = new PersonalHomeGenNHibernate.CAD.PersonalHome.VariableCAD();

                        newinstance.Variable = new System.Collections.Generic.List <PersonalHomeGenNHibernate.EN.PersonalHome.VariableEN>();
                        foreach (int entry in dto.Variable_oid)
                        {
                            newinstance.Variable.Add(variableCAD.ReadOIDDefault(entry));
                        }
                    }
                    if (dto.FamiliaPack_oid != null)
                    {
                        PersonalHomeGenNHibernate.CAD.PersonalHome.IFamiliaPackCAD familiaPackCAD = new PersonalHomeGenNHibernate.CAD.PersonalHome.FamiliaPackCAD();

                        newinstance.FamiliaPack = new System.Collections.Generic.List <PersonalHomeGenNHibernate.EN.PersonalHome.FamiliaPackEN>();
                        foreach (int entry in dto.FamiliaPack_oid)
                        {
                            newinstance.FamiliaPack.Add(familiaPackCAD.ReadOIDDefault(entry));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newinstance);
        }
コード例 #2
0
        public static TipoEstanciaEN Convert(TipoEstanciaDTO dto)
        {
            TipoEstanciaEN newinstance = null;

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



                    newinstance.IdTipoEstancia = dto.IdTipoEstancia;
                    newinstance.Nombre         = dto.Nombre;
                    newinstance.Descripcion    = dto.Descripcion;
                    newinstance.Imagen         = dto.Imagen;
                    if (dto.FamiliaPack_oid != null)
                    {
                        PersonalHomeGenNHibernate.CAD.PersonalHome.IFamiliaPackCAD familiaPackCAD = new PersonalHomeGenNHibernate.CAD.PersonalHome.FamiliaPackCAD();

                        newinstance.FamiliaPack = new System.Collections.Generic.List <PersonalHomeGenNHibernate.EN.PersonalHome.FamiliaPackEN>();
                        foreach (int entry in dto.FamiliaPack_oid)
                        {
                            newinstance.FamiliaPack.Add(familiaPackCAD.ReadOIDDefault(entry));
                        }
                    }
                    if (dto.Estancia_oid != null)
                    {
                        PersonalHomeGenNHibernate.CAD.PersonalHome.IEstanciaCAD estanciaCAD = new PersonalHomeGenNHibernate.CAD.PersonalHome.EstanciaCAD();

                        newinstance.Estancia = new System.Collections.Generic.List <PersonalHomeGenNHibernate.EN.PersonalHome.EstanciaEN>();
                        foreach (int entry in dto.Estancia_oid)
                        {
                            newinstance.Estancia.Add(estanciaCAD.ReadOIDDefault(entry));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newinstance);
        }