public async Task<ActionResult> Login(Login model)
{
ClaimsIdentity identity = null;
bool isAuthenticated = false;
StoredProcedure sp = new StoredProcedure(_connectionString);
if (ModelState.IsValid)
{
var user = model.user.ToUpper();
bool isUserBlackListed = model.blacklistedUser;
DateTime banDateTime = model.blacklistedUserBanDateTime;
sp.Check_BlackList(_connectionString, user, out isUserBlackListed, out banDateTime);
The last line is giving me a headache. I can't figure out why?
public static void Check_BlackList(string _connectionString, string Employee_Email, out bool isBlackListed, out DateTime blackListDateTime)
{
DataTable dt = new DataTable();
blackListDateTime = DateTime.Now.AddDays(1);
try
{
using (OracleConnection con = new OracleConnection(_connectionString))
{
OracleCommand cmd = new OracleCommand();
OracleDataAdapter da = new OracleDataAdapter();
cmd.Connection = con;
cmd.CommandText = "CHECK_BLACKLIST";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("T1_Cursor", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
cmd.Parameters.Add("P_EMPLOYEE_USERNAME", OracleDbType.Varchar2).Value = (Employee_Email);
da.SelectCommand = cmd;
da.Fill(dt);
if (dt.Rows.Count > 0)
{
isBlackListed = true;
DateTime.TryParse(dt.Rows[0]["ACCOUNT_STATUS_LAST_UPDATE"].ToString(), out blackListDateTime);
}
isBlackListed = false;
}
}
catch (OracleException ex)
{
Console.WriteLine(ex.ToString());
isBlackListed = false;
}
}
Severity Code Description Project File Line Suppression State Error CS0176 Member 'StoredProcedure.Check_BlackList(string, string, out bool, out DateTime)' cannot be accessed with an instance reference; qualify it with a type name instead Controllers\AuthenticationController.cs 40 Active