Esempio n. 1
0
        Load(LG.Data.Models.Auth.SecurityInfo eInput)
        {
            var client = LG.Services.ClientConnection.GetAmsConnection();

            try
            {
                //var response = client.
            }
            catch (Exception ex)
            {
            }

            return(null);
        }
Esempio n. 2
0
        Save(LG.Data.Models.Auth.SecurityInfo eInput)
        {
            var client = LG.Services.ClientConnection.GetAmsConnection();

            try
            {
                var response = client.CreateLoginAsync(
                    new CreateLoginRequest()
                {
                    RID                   = eInput.RID,
                    UserName              = eInput.UserName,
                    PlainPassword         = eInput.PlainPassword,
                    IsActive              = eInput.IsActive,
                    DTUTC_PasswordExpires = DateTime.UtcNow.AddYears(1),
                    MessageGuid           = Guid.NewGuid(),
                    IsTemporaryPassword   = eInput.IsTemporaryPassword,
                    PropBag               = eInput.PropBag
                });
                await response;
                if (response.IsCompleted)
                {
                    eInput.IsError = response.Result.ReturnStatus.IsError;
                    eInput.Message = response.Result.ReturnStatus.GeneralMessage;
                    return(eInput);
                }
                if (response.IsFaulted)
                {
                    eInput.IsError = true;
                    eInput.Message = "Faulted";
                    return(eInput);
                }
            }
            catch (Exception ex)
            {
                eInput.IsError = true;
                eInput.Message = ex.Message;
                return(eInput);
            }
            return(null);
        }
Esempio n. 3
0
        Login(LG.Data.Models.Auth.SecurityInfo eInput)
        {
            var client   = LG.Services.ClientConnection.GetAmsConnection();
            var response = client.AuthenticateUserAsync(new AuthenticateUserRequest()
            {
                MessageGuid = Guid.NewGuid(),
                UserName    = eInput.UserName,
                Password    = eInput.PlainPassword
            });

            try
            {
                await response;
                if (response.IsCompleted)
                {
                    return(response.Result);
                }
            }
            catch (Exception ex)
            {
                return(response.Result);
            }
            return(null);
        }
Esempio n. 4
0
 public static async Task <LG.Data.Models.Auth.SecurityInfo> Save(LG.Data.Models.Auth.SecurityInfo eInput)
 {
     return(await LG.Data.Core.Auth.AuthDataService.Save(eInput));
 }