Commit 2494bcb2 authored by Krishna Reddy Tamatam's avatar Krishna Reddy Tamatam

Changes done for Config values

parent 7791abca
......@@ -151,14 +151,14 @@ namespace FTP_Services.Services.Controllers
}
[HttpGet("GetConfigValues")]
public IActionResult GetConfigValues()
public IActionResult GetConfigValues(int CompanyId)
{
log.Debug("GetConfigValues ==> ");
try
{
_appSettings.ConnectionString = _appSettings.AdminConnectionString;
FTPDataAdapter adapter = new FTPDataAdapter(_appSettings);
List<ConfigValues>? RequestsList = adapter.ConfigValues();
List<ConfigValues>? RequestsList = adapter.ConfigValues(CompanyId);
return Ok(RequestsList);
}
catch (Exception ex)
......
......@@ -151,6 +151,7 @@ namespace FTP_Services.Core.Models
public int PDFSizeLimit { get; set; }
public string DefaultDocType { get; set; }
public bool IsActive { get; set; }
public int CompanyId { get; set; }
public ConfigValues()
{
......@@ -163,6 +164,7 @@ namespace FTP_Services.Core.Models
PDFSizeLimit =20;
DefaultDocType ="";
IsActive = true;
CompanyId= 1;
}
}
......
......@@ -130,7 +130,32 @@ namespace FTP_Services.Services
return null;
}
}
public List<ConfigValues>? ConfigValues()
// public List<ConfigValues>? ConfigValues(int CompanyId)
// {
// List<ConfigValues>? ConfigValuesData = null;
// try
// {
// using (var tx = _repository.GetTransaction())
// {
// ConfigValuesData = _repository.Fetch<ConfigValues>(
// "SELECT \"ID\", \"Environment\", \"RemotePath\", \"CompanyName\", \"FTPServiceURL\", \"DPI\", \"PDFSizeLimit\", \"DefaultDocType\", \"IsActive\" " +
// "FROM \"ScanConfigMaster\" " +
// "WHERE \"IsActive\" = TRUE " +
// "ORDER BY \"CompanyName\""
// );
// GC.Collect();
// tx.Complete();
// }
// return ConfigValuesData;
// }
// catch (Exception ex)
// {
// log.Error("ConfigValues->Failed to get info from db - " + ex.Message);
// return null;
// }
// }
public List<ConfigValues>? ConfigValues(int CompanyId)
{
List<ConfigValues>? ConfigValuesData = null;
try
......@@ -138,11 +163,9 @@ namespace FTP_Services.Services
using (var tx = _repository.GetTransaction())
{
ConfigValuesData = _repository.Fetch<ConfigValues>(
"SELECT \"ID\", \"Environment\", \"RemotePath\", \"CompanyName\", \"FTPServiceURL\", \"DPI\", \"PDFSizeLimit\", \"DefaultDocType\", \"IsActive\" " +
"FROM \"ScanConfigMaster\" " +
"WHERE \"IsActive\" = TRUE " +
"ORDER BY \"CompanyName\""
"SELECT * FROM \"SPScanTool_GetScanConfigByCompanyId\"(@0)", CompanyId
);
GC.Collect();
tx.Complete();
}
......@@ -163,8 +186,9 @@ namespace FTP_Services.Services
{
using (var tx = _repository.GetTransaction())
{
//"select \"SpecializationId\" as \"ID\", \"SpecializationName\" \"Name\" from \"Specialization\" WHERE \"Active\" = true ORDER BY \"Name\""
SpecialitiesData = _repository.Fetch<Specialities>(
"select \"SpecializationId\" as \"ID\", \"SpecializationName\" \"Name\" from \"Specialization\" WHERE \"Active\" = true ORDER BY \"Name\""
"SELECT * FROM \"SPScanTool_LoadDocumentCategories\"()"
);
GC.Collect();
tx.Complete();
......
{
"AppSettings": {
"ConnectionString": "SERVER=192.168.7.207;PORT=5432;UID=ff4dbuser;PWD=dbuser4ff123!;Database=fernandez_uat_20240913;Timeout=1000",
"ConnectionString": "SERVER=10.11.12.106;PORT=5432;UID=himsdbuser;PWD=dbuser@hims123!;database=fernandez_20241125;Timeout=1000",
"AdminConnectionString": "SERVER=10.11.12.106;PORT=5432;UID=himsdbuser;PWD=dbuser@hims123!;database=CareaxesAdmin;Timeout=1000",
"FTPConfiguration": {
"Username": "fernandez",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment