public string GetMetaDataTableCount() { string paramFileId = Request["fileId"] as string; Debug.WriteLine("* * * ExportController GetMetaDataTableCount fileId: " + paramFileId); int iFileId = Convert.ToInt32(paramFileId); IFormsSql formsSql = new FormsSql(); int rowCount = formsSql.GetTableRecordCountVenture(formsSql.GetMetaDataTableName(iFileId)); return(rowCount.ToString()); }
public FileStreamResult GetMetaCsv() { string paramFileId = Request["fileId"] as string; string paramVentureVersion = Request["ventureVersion"] as string; string msgVentureVersion = String.IsNullOrEmpty(paramVentureVersion) ? "* No ventureVersion. *" : paramVentureVersion; Debug.WriteLine("* * * ExportController GetMetaCsv fileId: " + paramFileId + " ventureVersion: " + msgVentureVersion); int fileId = 0; try { fileId = Convert.ToInt32(paramFileId); } catch (Exception exptn) { Debug.WriteLine("* * * ExportController GetMetaCsv Exception: " + exptn.Message); } Debug.WriteLine("* * * ExportController GetMetaCsv fileId: " + fileId.ToString()); IFormsSql formsSql = new FormsSql(); string tableName; if (!String.IsNullOrEmpty(paramVentureVersion)) { tableName = formsSql.GetMetaDataTableName(fileId); } else { tableName = formsSql.GetOldMetaDataTableName(fileId); } if (String.IsNullOrEmpty(tableName)) { string errMsg = "Error: Invalid fileId: " + paramFileId; return(ProcessError(errMsg)); } string sqlQuery = getMetaQuery(tableName); return(CreateCsvStream(formsSql.GetConnectionString(), sqlQuery)); }