Пример #1
0
        public CustomAttributeEntity AdaptItem(DataRow rw, DataTable dt)
        {
            CustomAttributeEntity result = new CustomAttributeEntity();

            if (dt.Columns.Contains("AttributeId"))
            {
                result.AttributeId = SafeHelper.GetSafeint(rw["AttributeId"]);
            }

            if (dt.Columns.Contains("AttributeName"))
            {
                result.AttributeName = SafeHelper.GetSafestring(rw["AttributeName"]);
            }

            if (dt.Columns.Contains("AttributeDataTypeCode"))
            {
                result.AttributeDataTypeCode = SafeHelper.GetSafestring(rw["AttributeDataTypeCode"]);
            }

            if (dt.Columns.Contains("TypeDescription"))
            {
                result.TypeDescription = SafeHelper.GetSafestring(rw["TypeDescription"]);
            }

            return(result);
        }
Пример #2
0
        public List <CustomAttributeEntity> Adapt(DataTable dt)
        {
            List <CustomAttributeEntity> results = new List <CustomAttributeEntity>();

            foreach (DataRow rw in dt.Rows)
            {
                CustomAttributeEntity customAttribute = new CustomAttributeEntity();
                customAttribute = AdaptItem(rw, dt);
                results.Add(customAttribute);
            }
            return(results);
        }