public void DeleteFileByGuid(Guid fileGuid) { _sqlDAc = new SqlDataAccess(_connectionString); _sqlValues = new Dictionary<string, object>(); _sqlValues.Add("@fileGUID", fileGuid); _sqlCommand = "DeletefsFile"; _sqlDAc.ExecuteByStoredProc(SqlDataAccess.ReturnType.NonQuery, _sqlCommand, ref _sqlValues); }
public Dictionary<string, string> GenerateFilePlaceholder() { _sqlDAc = new SqlDataAccess(_connectionString); _sqlValues = new Dictionary<string, object>(); _sqlCommand = "GeneratefsFilePlaceholder"; Dictionary<string, string> filePlaceholderInformations = new Dictionary<string, string>(); Object returnObject = _sqlDAc.ExecuteByStoredProc(SqlDataAccess.ReturnType.DataTable, _sqlCommand, ref _sqlValues); if (returnObject != null) { DataTable dataTable = (DataTable)returnObject; if (dataTable.Rows.Count > 0) { DataRow[] dr = dataTable.Select(); filePlaceholderInformations.Add("GUIDFile", dr[0]["GUIDFile"].ToString()); filePlaceholderInformations.Add("bdPathName", dr[0]["bdPathName"].ToString()); } } return filePlaceholderInformations; }
private string GetFileDbPathNameByGuid(Guid fileGuid) { string bdpathName; _sqlDAc = new SqlDataAccess(_connectionString); _sqlValues = new Dictionary<string, object>(); _sqlValues.Add("@fileGUID", fileGuid); _sqlCommand = "GetfsFilePathName"; Object returnObject = _sqlDAc.ExecuteByStoredProc(SqlDataAccess.ReturnType.DataTable, _sqlCommand, ref _sqlValues); if (returnObject != null) { DataTable dataTable = (DataTable)returnObject; //se for encontrado algum relatório no banco com a guid recebida if (dataTable.Rows.Count > 0) { DataRow[] dr = dataTable.Select(); //armazenando o guid e o pathName no array de strings bdpathName = dr[0]["bdPathName"].ToString(); } //Caso contrário retorna um array de bytes vazio else return string.Empty; return bdpathName; } else return string.Empty; }
private void UpdateReportStatus(Report report) { try { _sqlDAc = new SqlDataAccess(_connectionString); _sqlValues = new Dictionary<string, object>(); _sqlValues.Add("@reportGUID", report.ReportGuid); _sqlValues.Add("@jsonReportResult", JsonHelper.ConvertToJSON(report)); if (!report.ReportGenerationStatus) _sqlValues.Add("@errorDescription", report.ReportErrorDescription); _sqlCommand = "UpdateReportStatus"; _sqlDAc.ExecuteByStoredProc(SqlDataAccess.ReturnType.NonQuery, _sqlCommand, ref _sqlValues); } catch (Exception ex) { Exception newException = new Exception("Erro na geracao do historico do relatorio", ex); throw newException; } }
private void SaveReportsContainerInformation(ReportsContainer reportsContainer) { _sqlDAc = new SqlDataAccess(_connectionString); _sqlValues = new Dictionary<string, object>(); reportsContainer.ReportsContainerGuid = Guid.NewGuid(); _sqlValues.Add("@ReportsContainerGUID", reportsContainer.ReportsContainerGuid); _sqlValues.Add("@jsonReportsContainer", JsonHelper.ConvertToJSON(reportsContainer)); _sqlValues.Add("@NetworkDomain", reportsContainer.NetworkDomain); _sqlValues.Add("@ReportUserLogin", reportsContainer.ReportUserLogin); _sqlValues.Add("@ReportUserPassword", reportsContainer.ReportUserPassword); _sqlValues.Add("@ReportServiceUrl", reportsContainer.ReportServiceUrl); _sqlValues.Add("@ReportExecutionUrl", reportsContainer.ReportExecutionUrl); _sqlCommand = "SaveReportContainerInformation"; _sqlDAc.ExecuteByStoredProc(SqlDataAccess.ReturnType.NonQuery, _sqlCommand, ref _sqlValues); }
private void SaveReportInformation(Report report, ReportsContainer reportsContainer) { _sqlDAc = new SqlDataAccess(_connectionString); _sqlValues = new Dictionary<string, object>(); _sqlValues.Add("@jsonReport", JsonHelper.ConvertToJSON(report)); _sqlValues.Add("@ReportName", report.ReportName); _sqlValues.Add("@reportsContainerGUID", reportsContainer.ReportsContainerGuid); if (report.ReportGuid != new Guid()) _sqlValues.Add("@reportGUID", report.ReportGuid); _sqlCommand = "SaveReportInformation"; var result = _sqlDAc.ExecuteByStoredProc(SqlDataAccess.ReturnType.Scalar, _sqlCommand, ref _sqlValues); report.ReportGuid = new Guid(result.ToString()); }
private ReportsContainer GetReportsContainerByGUID(Guid reportsContainerGUID) { ReportsContainer reportsContainer = null; _sqlDAc = new SqlDataAccess(_connectionString); _sqlValues = new Dictionary<string, object>(); _sqlValues.Add("@reportsContainerGUID", reportsContainerGUID); _sqlCommand = "GetReportsContainerInformation"; Object returnObject = _sqlDAc.ExecuteByStoredProc(SqlDataAccess.ReturnType.DataTable, _sqlCommand, ref _sqlValues); if (returnObject != null) { DataTable dataTable = (DataTable)returnObject; if (dataTable.Rows.Count > 0) { DataRow[] dr = dataTable.Select(); reportsContainer = JsonHelper.ConvertToObject<ReportsContainer>(dr[0]["jsonReportsContainer"].ToString()); } } return reportsContainer; }