示例#1
0
        public Propiedades ConsultaDetalladaPropiedad(int IdPropiedades)
        {
            Propiedades res = null;

            using (var ctx = new DB_A66D31_intratecPrbEntities1())
            {
                res = ctx.Propiedades.Where(c => c.IdPropiedades == IdPropiedades).FirstOrDefault();
                if (res != null)
                {
                    res.ToString();
                }
                else
                {
                    throw new Exception($"No existe una propiedad con ID {IdPropiedades}");
                }
            }
            return(res);
        }
示例#2
0
        /// <summary>
        /// devuelve el indice del objeto donde se encuentra el metodo
        /// </summary>
        /// <param name="Metodo">Nombre del metodo</param>
        /// <returns>Indice de la coleccion donde se encuentra el metodo</returns>
        public int Find(string Metodo)
        {
            int  iRetorno  = -1;
            int  iIndice   = -1;
            bool bEncontro = false;

            foreach (Ensamblado Ensa in this)
            {
                foreach (Type tt in Ensa.Tipos)
                {
                    if (!bEncontro)
                    {
                        foreach (MethodInfo Metodos in tt.GetMethods())
                        {
                            if (Metodos.ToString() == Metodo)
                            {
                                bEncontro = true;
                                break;
                            }
                        }
                    }
                    if (!bEncontro)
                    {
                        foreach (PropertyInfo Propiedades in tt.GetProperties())
                        {
                            if (Propiedades.ToString() == Metodo)
                            {
                                bEncontro = true;
                                break;
                            }
                        }
                    }
                    if (!bEncontro)
                    {
                        //foreach (ConstructorInfo Constructores in tt.GetConstructors())
                        {
                            string[] NombreConstructor = tt.FullName.Split('.');
                            if (NombreConstructor[NombreConstructor.Length - 1] == Metodo)
                            {
                                bEncontro = true;
                                break;
                            }
                        }
                    }
                    if (!bEncontro)
                    {
                        foreach (EventInfo Eventos in tt.GetEvents())
                        {
                            if (Eventos.ToString() == Metodo)
                            {
                                bEncontro = true;
                                break;
                            }
                        }
                    }
                }
                iIndice++;
                if (bEncontro)
                {
                    iRetorno = iIndice;
                    break;
                }
            }
            return(iRetorno);
        }