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

for v3.0

parent e89870e9
......@@ -136,6 +136,22 @@ namespace FTP_Services.Services.Controllers
}
}
[HttpGet("GetUserRights")]
public IActionResult GetUserRights(int UserId)
{
log.Debug("GetUserRights ==> ");
try
{
FTPDataAdapter adapter = new FTPDataAdapter(_appSettings);
List<object>? RequestsList = adapter.GetUserRights(UserId);
return Ok(RequestsList);
}
catch (Exception ex)
{
log.Error("Fail to get data for GetUserRights - Error:" + ex.Message);
return NotFound("No results");
}
}
[HttpGet("GetLocations")]
public IActionResult GetLocations(Boolean IsLoadAll,Boolean IsOldData) //int LocationId,
{
......
......@@ -431,6 +431,32 @@ namespace FTP_Services.Services
}
}
public List<object>? GetUserRights(int UserId)
{
List<object>? UserRightsData = null;
try
{
using (var tx = _repository.GetTransaction())
{
string sqlQuery =
$"SELECT * FROM \"SPScanTool_GetUserRights\"(@Parm_UserId)";
UserRightsData = _repository.Fetch<object>(
sqlQuery,
new { Parm_UserId = UserId }
);
GC.Collect();
tx.Complete();
}
return UserRightsData;
}
catch (Exception ex)
{
log.Error("UserRightsData->Failed to get info from db - " + ex.Message);
return null;
}
}
public List<DocumentCategories>? DocumentCategories()
{
List<DocumentCategories>? DocumentCategoriesData = null;
......
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