Пример #1
0
        public static List <T_Ambiente> GetAllAmbientes()
        {
            var ambientesPage = GetWorkSheetByName("Ambientes");

            List <T_Ambiente> _allAmbientes = new List <T_Ambiente>();

            for (int i = 2; i < ambientesPage.Dimension.Rows + 1; i++)
            {
                var        _id          = ambientesPage.Cells[i, 1].Value.ToString();
                var        _suelo       = ambientesPage.Cells[i, 3].Value.ToString();
                var        _rodapie     = ambientesPage.Cells[i, 4].Value.ToString();
                var        _pared       = ambientesPage.Cells[i, 5].Value.ToString();
                var        _techo       = ambientesPage.Cells[i, 6].Value.ToString();
                var        _impermeable = ambientesPage.Cells[i, 7].Value.ToString();
                T_Ambiente _ambiente    = new T_Ambiente()
                {
                    Id          = int.Parse(_id),
                    Nombre      = ambientesPage.Cells[i, 2].Value.ToString(),
                    Suelo       = new DB_PLANTILLA().GetSingleRecord <T_Catalogo_Suelo>(x => x.Cod == _suelo).Id,
                    Pared       = new DB_PLANTILLA().GetSingleRecord <T_Catalogo_Pared>(x => x.Cod == _pared).Id,
                    Rodapie     = new DB_PLANTILLA().GetSingleRecord <T_Catalogo_Rodapie>(x => x.Cod == _rodapie).Id,
                    Techo       = new DB_PLANTILLA().GetSingleRecord <T_Catalogo_Techo>(x => x.Cod == _techo).Id,
                    Impermeable = new DB_PLANTILLA().GetSingleRecord <T_Catalogo_Impermeable>(x => x.Cod == _impermeable).Id
                };

                _allAmbientes.Add(_ambiente);
            }

            return(_allAmbientes);
        }
Пример #2
0
        public static Ambiente ToProject(this T_Ambiente t_ambiente)
        {
            Ambiente _ambiente = new Ambiente()
            {
                Impermeable = t_ambiente.Impermeable,
                Nombre      = t_ambiente.Nombre,
                Pared       = t_ambiente.Pared,
                Rodapie     = t_ambiente.Rodapie,
                Suelo       = t_ambiente.Suelo,
                Techo       = t_ambiente.Techo
            };

            return(_ambiente);
        }