Align .editorconfig files Move Controller logic to DMO classes GlobalVars.AppSettings = Models.AppSettings.GetFromConfigurationManager(); Question EditorConfig Project level editorconfig Format White Spaces AppSetting when EnvironmentVariable not set Corrective Actions Tests Schedule Actions Tests DMO Tests Controller Tests Get ready to use VSCode IDE
20 lines
657 B
C#
20 lines
657 B
C#
using System.Configuration;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
using Dapper;
|
|
|
|
namespace Fab2ApprovalSystem.DMO;
|
|
|
|
public class SAM_DMO {
|
|
private readonly IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["SAMDBConnectionString"].ConnectionString);
|
|
|
|
public int HasITARAccess(string userID) {
|
|
StringBuilder query = new("SELECT COUNT(*) FROM dbo.fnIsUserITARCompliant(@UserID) ");
|
|
//query.Append("WHERE UserID = @UserID AND AND EmployeeStatus = 'Active'");
|
|
return db.Query<int>(query.ToString(), new { UserID = userID }).SingleOrDefault();
|
|
}
|
|
|
|
} |