Commit 6e5e5a38 authored by Krishna Reddy Tamatam's avatar Krishna Reddy Tamatam

Added ConfigValues method

parent 18ca23ec
......@@ -134,7 +134,6 @@ namespace FTP_Services.Services.Controllers
}
}
[HttpGet("LoadDocumentCategories")]
public IActionResult LoadDocumentCategories()
{
......@@ -152,6 +151,24 @@ namespace FTP_Services.Services.Controllers
}
}
[HttpGet("GetConfigValues")]
public IActionResult GetConfigValues()
{
log.Debug("GetConfigValues ==> ");
try
{
_appSettings.ConnectionString = _appSettings.AdminConnectionString;
FTPDataAdapter adapter = new FTPDataAdapter(_appSettings);
List<ConfigValues>? RequestsList = adapter.ConfigValues();
return Ok(RequestsList);
}
catch (Exception ex)
{
log.Error("Fail to get data for GetConfigValues - Error:" + ex.Message);
return NotFound("No results");
}
}
[HttpGet("GetSpecialities")]
public IActionResult GetSpecialities()
{
......
......@@ -3,10 +3,12 @@ namespace FTP_Services.Core.Models
public class AppSettings
{
public string ConnectionString { get; set; }
public string AdminConnectionString { get; set; }
public AppSettings()
{
ConnectionString = "";
AdminConnectionString ="";
}
public FTPConfiguration FTPConfiguration { get; set; }
......
......@@ -139,6 +139,30 @@ namespace FTP_Services.Core.Models
Name = "";
}
}
public class ConfigValues
{
public int ID { get; set; }
public string Environment { get; set; }
public string RemotePath { get; set; }
public string CompanyName { get; set; }
public string FTPServiceURL { get; set; }
public int DPI { get; set; }
public int PDFSizeLimit { get; set; }
public bool IsActive { get; set; }
public ConfigValues()
{
ID = -1;
Environment = "";
RemotePath = "";
CompanyName = "";
FTPServiceURL = "";
DPI =100;
PDFSizeLimit =20;
IsActive = true;
}
}
public class PatientDocuments
{
......
......@@ -147,6 +147,7 @@ if (app.Environment.IsDevelopment())
}
else
{
//app.Run();
app.Run("http://*:4708");
}
......@@ -130,6 +130,31 @@ namespace FTP_Services.Services
return null;
}
}
public List<ConfigValues>? ConfigValues()
{
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<Specialities>? Specialities()
{
......@@ -191,10 +216,10 @@ namespace FTP_Services.Services
+ SndPatDocRec.PatDocId
+ ",'"
+ SndPatDocRec.UploadedDate
+"',"
+ "',"
+ SndPatDocRec.PatientId
+ ",'"
+ SndPatDocRec.UploadedBy
+ SndPatDocRec.UploadedBy
+ "','"
+ SndPatDocRec.DocumentName
+ "','"
......
{
"AppSettings": {
"ConnectionString": "SERVER=192.168.7.207;PORT=5432;UID=ff4dbuser;PWD=dbuser4ff123!;Database=fernandez_uat_20240913;Timeout=1000",
"AdminConnectionString": "SERVER=10.11.12.106;PORT=5432;UID=himsdbuser;PWD=dbuser@hims123!;database=CareaxesAdmin;Timeout=1000",
"FTPConfiguration": {
"Username": "fernandez",
"Password": "fernandez123!",
......
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