예제 #1
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);
        }
예제 #2
0
        public static VistaEN Convert(VistaDTO dto)
        {
            VistaEN newinstance = null;

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



                    newinstance.IdVista = dto.IdVista;
                    newinstance.Nombre  = dto.Nombre;
                    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));
                        }
                    }
                    if (dto.Inmueble_oid != null)
                    {
                        PersonalHomeGenNHibernate.CAD.PersonalHome.IInmuebleCAD inmuebleCAD = new PersonalHomeGenNHibernate.CAD.PersonalHome.InmuebleCAD();

                        newinstance.Inmueble = new System.Collections.Generic.List <PersonalHomeGenNHibernate.EN.PersonalHome.InmuebleEN>();
                        foreach (int entry in dto.Inmueble_oid)
                        {
                            newinstance.Inmueble.Add(inmuebleCAD.ReadOIDDefault(entry));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newinstance);
        }