public void Authorization(Authorization authorization) { try { Connect(); } catch (Exception e) { Error(e); Disconnect(); return; } var request = JsonSerializer.Serialize(new Request { Type = RequestType.Authorization, Data = JsonSerializer.Serialize(authorization) }); SendRequest(request); }
public AuthorizationResult Authorize(Authorization authorization) { AuthorizationResult result; var card = dataBase.GetCardById(authorization.CardId); if (card.Password == authorization.Password) { result = new AuthorizationResult { Success = true } } ; else { result = new AuthorizationResult { Success = false, Message = "Неверный пин-код" } }; return(result); }