Beispiel #1
0
    public System.Threading.Tasks.Task <GetLoginResponse1> GetLoginAsync(GetLoginRequest GetLoginRequest)
    {
        GetLoginRequest1 inValue = new GetLoginRequest1();

        inValue.GetLoginRequest = GetLoginRequest;
        return(((LoginService)(this)).GetLoginAsync(inValue));
    }
Beispiel #2
0
        GetLoginResponse ILoginService.LoginResponse(GetLoginRequest prmLoginRequest)
        {
            GetLoginResponse loginResponse = new GetLoginResponse();

            try
            {
                ClientesDTO clientesDTO;
                ICustomerServiceBusiness iCSBusiness;

                clientesDTO = new ClientesDTO
                {
                    User     = prmLoginRequest.Login.User,
                    Password = prmLoginRequest.Login.Password
                };

                iCSBusiness   = new CustomerServicesBusiness();
                loginResponse = iCSBusiness.GetResultLoginDTOs(clientesDTO);
            }
            catch (Exception ex)
            {
                loginResponse.status.CodeResp    = "01";
                loginResponse.status.MessageResp = "Error en el Servicio";
                Common.CreateTrace.WriteLog(Common.CreateTrace.LogLevel.Error, "ERROR EN EL SERVICIO CustomerService:LoginCustomer " + ex.Message);
                throw ex;
            }


            return(loginResponse);
        }
 public async Task<LoginDto> Get([FromUri] int id)
 {
     var request = new GetLoginRequest
     {
         Id = id
     };
     return await _mediator.ExecuteAsync(request).ConfigureAwait(false);
 }
Beispiel #4
0
    public GetLoginResponse GetLogin(GetLoginRequest GetLoginRequest)
    {
        GetLoginRequest1 inValue = new GetLoginRequest1();

        inValue.GetLoginRequest = GetLoginRequest;
        GetLoginResponse1 retVal = ((LoginService)(this)).GetLogin(inValue);

        return(retVal.GetLoginResponse);
    }
Beispiel #5
0
        public async Task <LoginDto> Get([FromUri] int id)
        {
            var request = new GetLoginRequest
            {
                Id = id
            };

            return(await _mediator.ExecuteAsync(request).ConfigureAwait(false));
        }
        public async Task <ActionResult> LoginRequest([FromBody] GetLoginRequest request)
        {
            var IsAuthorized = await userService.IsAuthorized(request.User, request.Pass);

            if (IsAuthorized)
            {
                //  base64 UTF8 (request.User:request.pass)
                var account      = $"{request.User}:{request.Pass}";
                var accountBytes = System.Text.Encoding.UTF8.GetBytes(account);

                var result = new { accessToken = Convert.ToBase64String(accountBytes) };
                return(Ok(result));
            }
            return(Unauthorized());
        }
Beispiel #7
0
 public LoginResponses GetLoginPhoneBooks(GetLoginRequest getLoginRequest)
 {
     try
     {
         using (var dbcontext = new PhoneBooksContext())
         {
             var users = dbcontext.Logins.Where(user => user.Password.Equals(getLoginRequest.Password) &&
                                                user.Username.Equals(getLoginRequest.Username)).FirstOrDefault();
             return(new LoginResponses {
                 Username = users.Username, Success = true, Message = string.Empty
             });
         }
     }
     catch (Exception ex)
     {
         return(new LoginResponses {
             Username = string.Empty, Success = false, Message = ex.Message
         });
     }
 }
Beispiel #8
0
 public GetLoginRequest1(GetLoginRequest GetLoginRequest)
 {
     this.GetLoginRequest = GetLoginRequest;
 }
Beispiel #9
0
        public LoginResponses GetUserLogin([FromBody] GetLoginRequest getLoginRequest)
        {
            var response = _services.GetLoginPhoneBooks(getLoginRequest);

            return(response);
        }