示例#1
0
        public List <OICompanyEntity> Adapt(DataTable dt)
        {
            List <OICompanyEntity> results = new List <OICompanyEntity>();

            foreach (DataRow rw in dt.Rows)
            {
                OICompanyEntity cust = new OICompanyEntity();
                cust = AdaptItem(rw);
                results.Add(cust);
            }
            return(results);
        }
示例#2
0
        public OICompanyEntity AdaptItem(DataRow rw)
        {
            OICompanyEntity result = new OICompanyEntity();

            if (rw.Table.Columns["InputId"] != null)
            {
                result.InputId = SafeHelper.GetSafestring(rw["InputId"]);
            }

            if (rw.Table.Columns["SrcRecordId"] != null)
            {
                result.SrcRecordId = SafeHelper.GetSafestring(rw["SrcRecordId"]);
            }

            if (rw.Table.Columns["ImportProcessId"] != null)
            {
                result.ImportProcessId = SafeHelper.GetSafeint(rw["ImportProcessId"]);
            }

            if (rw.Table.Columns["InpCompanyName"] != null)
            {
                result.InpCompanyName = SafeHelper.GetSafestring(rw["InpCompanyName"]);
            }

            if (rw.Table.Columns["InpAddress1"] != null)
            {
                result.InpAddress1 = SafeHelper.GetSafestring(rw["InpAddress1"]);
            }

            if (rw.Table.Columns["InpAddress2"] != null)
            {
                result.InpAddress2 = SafeHelper.GetSafestring(rw["InpAddress2"]);
            }

            if (rw.Table.Columns["InpCity"] != null)
            {
                result.InpCity = SafeHelper.GetSafestring(rw["InpCity"]);
            }

            if (rw.Table.Columns["InpState"] != null)
            {
                result.InpState = SafeHelper.GetSafestring(rw["InpState"]);
            }

            if (rw.Table.Columns["InpPostalCode"] != null)
            {
                result.InpPostalCode = SafeHelper.GetSafestring(rw["InpPostalCode"]);
            }

            if (rw.Table.Columns["InpCountryISOAlpha2Code"] != null)
            {
                result.InpCountryISOAlpha2Code = SafeHelper.GetSafestring(rw["InpCountryISOAlpha2Code"]);
            }

            if (rw.Table.Columns["InpPhoneNbr"] != null)
            {
                result.InpPhoneNbr = SafeHelper.GetSafestring(rw["InpPhoneNbr"]);
            }

            if (rw.Table.Columns["InpOrbNum"] != null)
            {
                result.InpOrbNum = SafeHelper.GetSafestring(rw["InpOrbNum"]);
            }

            if (rw.Table.Columns["InpEIN"] != null)
            {
                result.InpEIN = SafeHelper.GetSafestring(rw["InpEIN"]);
            }

            if (rw.Table.Columns["InpCEOName"] != null)
            {
                result.InpCEOName = SafeHelper.GetSafestring(rw["InpCEOName"]);
            }

            if (rw.Table.Columns["InpWebsite"] != null)
            {
                result.InpWebsite = SafeHelper.GetSafestring(rw["InpWebsite"]);
            }

            if (rw.Table.Columns["InpEmail"] != null)
            {
                result.InpEmail = SafeHelper.GetSafestring(rw["InpEmail"]);
            }

            if (rw.Table.Columns["InpAltCompanyName"] != null)
            {
                result.InpAltCompanyName = SafeHelper.GetSafestring(rw["InpAltCompanyName"]);
            }

            if (rw.Table.Columns["InpAltAddress1"] != null)
            {
                result.InpAltAddress1 = SafeHelper.GetSafestring(rw["InpAltAddress1"]);
            }

            if (rw.Table.Columns["InpAltAddress2"] != null)
            {
                result.InpAltAddress2 = SafeHelper.GetSafestring(rw["InpAltAddress2"]);
            }

            if (rw.Table.Columns["InpAltCity"] != null)
            {
                result.InpAltCity = SafeHelper.GetSafestring(rw["InpAltCity"]);
            }

            if (rw.Table.Columns["InpAltState"] != null)
            {
                result.InpAltState = SafeHelper.GetSafestring(rw["InpAltState"]);
            }

            if (rw.Table.Columns["InpAltPostalCode"] != null)
            {
                result.InpAltPostalCode = SafeHelper.GetSafestring(rw["InpAltPostalCode"]);
            }

            if (rw.Table.Columns["InpAltCountryISOAlpha2Code"] != null)
            {
                result.InpAltCountryISOAlpha2Code = SafeHelper.GetSafestring(rw["InpAltCountryISOAlpha2Code"]);
            }

            if (rw.Table.Columns["Tags"] != null)
            {
                result.Tags = SafeHelper.GetSafestring(rw["Tags"]);
            }

            if (rw.Table.Columns["inpStdStreetNum"] != null)
            {
                result.inpStdStreetNum = SafeHelper.GetSafestring(rw["inpStdStreetNum"]);
            }

            if (rw.Table.Columns["inpStdStreetName"] != null)
            {
                result.inpStdStreetName = SafeHelper.GetSafestring(rw["inpStdStreetName"]);
            }

            if (rw.Table.Columns["InpStdCity"] != null)
            {
                result.InpStdCity = SafeHelper.GetSafestring(rw["InpStdCity"]);
            }

            if (rw.Table.Columns["InpStdState"] != null)
            {
                result.InpStdState = SafeHelper.GetSafestring(rw["InpStdState"]);
            }

            if (rw.Table.Columns["InpStdPostalCode"] != null)
            {
                result.InpStdPostalCode = SafeHelper.GetSafestring(rw["InpStdPostalCode"]);
            }

            if (rw.Table.Columns["inpStdAltStreetNum"] != null)
            {
                result.inpStdAltStreetNum = SafeHelper.GetSafestring(rw["inpStdAltStreetNum"]);
            }

            if (rw.Table.Columns["inpStdAltStreetName"] != null)
            {
                result.inpStdAltStreetName = SafeHelper.GetSafestring(rw["inpStdAltStreetName"]);
            }

            if (rw.Table.Columns["InpStdAltCity"] != null)
            {
                result.InpStdAltCity = SafeHelper.GetSafestring(rw["InpStdAltCity"]);
            }

            if (rw.Table.Columns["InpStdAltState"] != null)
            {
                result.InpStdAltState = SafeHelper.GetSafestring(rw["InpStdAltState"]);
            }

            if (rw.Table.Columns["InpStdAltPostalCode"] != null)
            {
                result.InpStdAltPostalCode = SafeHelper.GetSafestring(rw["InpStdAltPostalCode"]);
            }

            if (rw.Table.Columns["ProcessStatusId"] != null)
            {
                result.ProcessStatusId = SafeHelper.GetSafeint(rw["ProcessStatusId"]);
            }

            if (rw.Table.Columns["Matched"] != null)
            {
                result.Matched = SafeHelper.GetSafebool(rw["Matched"]);
            }

            if (rw.Table.Columns["MatchedOrbNum"] != null)
            {
                result.MatchedOrbNum = SafeHelper.GetSafestring(rw["MatchedOrbNum"]);
            }

            if (rw.Table.Columns["MatchedOrbNumFirmographics"] != null)
            {
                result.MatchedOrbNumFirmographics = SafeHelper.GetSafestring(rw["MatchedOrbNumFirmographics"]);
            }

            if (rw.Table.Columns["MatchedDateTime"] != null)
            {
                result.MatchedDateTime = SafeHelper.GetSafeDateTime(rw["MatchedDateTime"]);
            }

            if (rw.Table.Columns["MatchedBy"] != null)
            {
                result.MatchedBy = SafeHelper.GetSafestring(rw["MatchedBy"]);
            }

            if (rw.Table.Columns["Exported"] != null)
            {
                result.Exported = SafeHelper.GetSafebool(rw["Exported"]);
            }

            if (rw.Table.Columns["ExportedDateTime"] != null)
            {
                result.ExportedDateTime = SafeHelper.GetSafeDateTime(rw["ExportedDateTime"]);
            }

            if (rw.Table.Columns["Deleted"] != null)
            {
                result.Deleted = SafeHelper.GetSafebool(rw["Deleted"]);
            }

            if (rw.Table.Columns["CandidateCount"] != null)
            {
                result.CandidateCount = SafeHelper.GetSafeint(rw["CandidateCount"]);
            }

            if (rw.Table.Columns["NbrMatchCalls"] != null)
            {
                result.NbrMatchCalls = SafeHelper.GetSafeint(rw["NbrMatchCalls"]);
            }

            return(result);
        }