Ejemplo n.º 1
0
        //Get columns names for display in mapping
        public List <string> GetcolumnName(string ImportType, string ConnectionString)
        {
            SettingFacade sfac         = new SettingFacade(ConnectionString);
            DataTable     dtInpCompany = new DataTable();
            List <string> columnName   = new List <string>();

            if (ImportType.ToLower().Trim() == "match refresh")
            {
                dtInpCompany = sfac.GetImportDataRefreshColumnsName();
            }
            else if (ImportType.ToLower().Trim() == "data import")
            {
                dtInpCompany = sfac.GetInpCompanyColumnsName();
            }
            else if (ImportType.ToLower().Trim() == "orb data import")
            {
                OIImportDataFacade orbfac = new OIImportDataFacade(this.CurrentClient.ApplicationDBConnectionString);
                dtInpCompany = orbfac.GetOIStgInputCompanyColumnsName();
            }
            //added orb enrichment only dropdown in upload configuration
            else if (ImportType.ToLower().Trim() == "orb match refresh")
            {
                OISettingFacade oisfac = new OISettingFacade(this.CurrentClient.ApplicationDBConnectionString);
                dtInpCompany = oisfac.GetOIImportDataColumnsName();
            }
            if (dtInpCompany.Rows.Count > 0)
            {
                for (int k = 0; k < dtInpCompany.Rows.Count; k++)  //loop through the columns.
                {
                    if (Convert.ToString(dtInpCompany.Rows[k][0]) != "ImportRowId" && Convert.ToString(dtInpCompany.Rows[k][0]) != "ImportProcessId")
                    {
                        if (ImportType.ToLower().Trim() == "orb data import" || ImportType.ToLower().Trim() == "orb match refresh")
                        {
                            if (Convert.ToString(dtInpCompany.Rows[k][0]) == "Address1")
                            {
                                columnName.Add("Street Line Address1");
                            }
                            else if (Convert.ToString(dtInpCompany.Rows[k][0]) == "Address2")
                            {
                                columnName.Add("Street Line Address2");
                            }
                            else if (Convert.ToString(dtInpCompany.Rows[k][0]) == "AltAddress1")
                            {
                                columnName.Add("Street Line Alt. Address1");
                            }
                            else if (Convert.ToString(dtInpCompany.Rows[k][0]) == "AltAddress2")
                            {
                                columnName.Add("Street Line Alt. Address2");
                            }
                            else
                            {
                                columnName.Add(Convert.ToString(dtInpCompany.Rows[k][0]));
                            }
                        }
                        else
                        {
                            if (Convert.ToString(dtInpCompany.Rows[k][0]) == "Address")
                            {
                                columnName.Add("Street Line Address1");
                            }
                            else if (Convert.ToString(dtInpCompany.Rows[k][0]) == "Address1")
                            {
                                columnName.Add("Street Line Address2");
                            }
                            else if (Convert.ToString(dtInpCompany.Rows[k][0]) == "AltAddress")
                            {
                                columnName.Add("Street Line Alt. Address1");
                            }
                            else if (Convert.ToString(dtInpCompany.Rows[k][0]) == "AltAddress1")
                            {
                                columnName.Add("Street Line Alt. Address2");
                            }
                            else
                            {
                                columnName.Add(Convert.ToString(dtInpCompany.Rows[k][0]));
                            }
                        }
                    }
                }
            }
            return(columnName);
        }