public static SelectList GetDataImportProcess(string ConnectionString) { OIImportDataFacade fac = new OIImportDataFacade(ConnectionString); DataTable dt = fac.GetDataImportProcess(); List <SelectListItem> lstImportProcess = new List <SelectListItem>(); for (int i = 0; i < dt.Rows.Count; i++) { lstImportProcess.Add(new SelectListItem { Value = dt.Rows[i]["ImportProcess"].ToString(), Text = dt.Rows[i]["ImportProcess"].ToString() }); } return(new SelectList(lstImportProcess, "Value", "Text")); }
//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); }