/// <summary> /// Admin Login Details /// </summary> /// <param name="userName"></param> /// <param name="password"></param> /// <returns></returns> public CommonResponseWithUserName AdminLoginDetails(string userName, string password) { CommonResponseWithUserName obj = new CommonResponseWithUserName(); CommonFunction commonFunction = new CommonFunction(); try { var check = (from wf in db.UnitworkccsTbloperatordetails where wf.UserName == userName && wf.Password == password && wf.RoleId == 11 select new { OperatorName = wf.OperatorName, OpId = wf.OpId, RoleId = wf.RoleId }).FirstOrDefault(); if (check != null) { obj.isStatus = true; obj.response = check; obj.id = check.OpId; obj.userName = check.OperatorName; } else { obj.isStatus = false; obj.response = "Not Authorized User"; } } catch (Exception e) { log.Error(e); if (e.InnerException != null) { log.Error(e.InnerException.ToString()); } obj.isStatus = false; obj.response = ResourceResponse.FailureMessage; } return(obj); }
public async Task<IActionResult> AdminLoginDetails(string userName, string password) { CommonResponseWithUserName response = login.AdminLoginDetails(userName, password); return Ok(response); }