Ejemplo n.º 1
0
 public UserDtoModel ValidateAccount(LoginDtoModel user)
 {
     try
     {
         return(_staffProvider.ValidateStaffAccount(user));
     }
     catch (Exception ex)
     {
         ex.ToString();
         return(null);
     }
 }
        public IHttpActionResult ValidateAccount(LoginDtoModel account)
        {
            UserDtoModel user = _staffFacade.ValidateAccount(account);

            if (user != null)
            {
                return(Ok(user));
            }
            else
            {
                return(Unauthorized());
            }
        }
        public UserDtoModel ValidateStaffAccount(LoginDtoModel account)
        {
            UserDtoModel result      = null;
            var          queryResult = _uow.GetDB().usp_CheckStaffAccount(account.Email, account.Password);

            if (queryResult != null)
            {
                var user = queryResult.FirstOrDefault();
                result = new UserDtoModel()
                {
                    StaffID   = user.StaffID,
                    FirstName = user.FirstName,
                    RoleID    = user.RoleID
                };
            }
            return(result);
        }