Exemplo n.º 1
0
        // Lay mot 1 Kieu cua mot thuoc tinh nao do trong Entry

        public System.Data.OleDb.OleDbType GetPropertyType(PropertyInfo Pinfo)
        {
            System.Data.OleDb.OleDbType Catchtype = 0;
            object[] Attributes = Pinfo.GetCustomAttributes(typeof(DBPropertyAttribute), false);
            if (Attributes.Length == 1)
            {
                try
                {
                    DBPropertyAttribute Attrib = (DBPropertyAttribute)Attributes[0];
                    Catchtype = Attrib.PropertyType;
                }
                catch (Exception EX)
                {
                    Except.SetException(EX);
                }
            }
            return(Catchtype);
        }
Exemplo n.º 2
0
        // Lay length cua Field

        public int GetPropertyLength(PropertyInfo Pinfo)
        {
            int Catchint = 0;

            object[] Attributes = Pinfo.GetCustomAttributes(typeof(DBPropertyAttribute), false);
            if (Attributes.Length == 1)
            {
                try
                {
                    DBPropertyAttribute Attrib = (DBPropertyAttribute)Attributes[0];
                    Catchint = Attrib.Length;
                }
                catch (Exception EX)
                {
                    Except.SetException(EX);
                }
            }
            return(Catchint);;
        }
Exemplo n.º 3
0
        // Lay mot ten tuy bien(AttributeName) cua 1 thuoc tinh nao do trong Entry

        public string GetPropertyName(PropertyInfo Pinfo)
        {
            string Catchname = "";

            object[] Attributes = Pinfo.GetCustomAttributes(typeof(DBPropertyAttribute), false);
            if (Attributes.Length == 1)
            {
                try
                {
                    DBPropertyAttribute Attrib = (DBPropertyAttribute)Attributes[0];
                    Catchname = Attrib.PropertyName;
                }
                catch (Exception EX)
                {
                    Except.SetException(EX);
                }
            }
            return(Catchname);
        }