예제 #1
0
        public static async Task <LG.Data.Models.Members.Entity> CreateEntityTask(LG.Data.Models.Members.Entity entity)
        {
            var client = ClientConnection.GetEmsConnection();

            try
            {
                client.Open();
                var response = await client.CreateBEntityAsync(new CreateBEntityRequest
                {
                    MessageGuid = new Guid(),
                    RType       = entity.EntityType,
                    IsActive    = entity.AccountInfo.IsActive,
                    IsTesting   = entity.AccountInfo.IsTesting,
                    PropBag     = EntityDataService.PropBag
                });

                client.Close();
                if (response.RID != null)
                {
                    entity.RID = response.RID.Value;
                }
                entity.IsError = false;
                entity.Events.EventActionResult = ActionResult.Success;
                return(entity);
            }
            catch (Exception ex)
            {
                client.Close();
                entity.IsError = true;
                entity.Message = ex.ToString();
                entity.Events.EventActionResult = ActionResult.Failed;
                return(entity);
            }
        }
예제 #2
0
        public static async Task <LG.Data.Models.Members.Entity> AddressSaveTask(LG.Data.Models.Members.Entity entity)
        {
            var client = ClientConnection.GetEmsConnection();

            try
            {
                client.Open();
                if (entity.Events.EventAction == Models.Enums.Action.Add)
                {
                    #region [@  Add     @]

                    var response = await client.AddAddressAsync(
                        new AddAddressRequest()
                    {
                        Address = entity.Addresses[0]
                    });

                    client.Close();

                    #endregion

                    entity.IsError = false;
                    entity.Events.EventActionResult = ActionResult.Success;
                    return(entity);
                }
                else
                {
                    #region [@  Update  @]
                    var response = await client.UpdateAddressAsync(
                        new UpdateAddressRequest()
                    {
                        NewAddress               = entity.Addresses[1],
                        IsPrimary                = entity.Addresses[1].AddressUsages[0].IsPrimary,
                        AddressIDToUpdate        = entity.Addresses[0].ID,
                        NewAddressUsageEnum      = entity.Addresses[1].AddressUsages[0].AddressUsageEnum,
                        AddressUsageEnumToUpdate = entity.Addresses[0].AddressUsages[0].AddressUsageEnum,
                        MessageGuid              = new Guid(),
                        PropBag = EntityDataService.PropBag,
                        RID     = entity.RID,
                    });

                    client.Close();
                    #endregion

                    entity.IsError = false;
                    entity.Events.EventActionResult = ActionResult.Success;
                    return(entity);
                }
            }
            catch (Exception ex)
            {
                client.Close();
                entity.IsError = true;
                entity.Message = ex.ToString();
                entity.Events.EventActionResult = ActionResult.Failed;
                return(entity);
            }
        }
예제 #3
0
        public async Task <bool> Load()
        {
            if (Identity == null && RolodexItemID == 0)
            {
                return(false);
            }
            if (Identity != null)
            {
                IsAuthenticated = true;

                RolodexItemID = Identity.RID;

                Entity = await LG.Data.Members.MemberService.LoadDetail(
                    Identity.RID);

                PersonInfo = await LG.Data.Shared.EntityService.LoadPersonInfo(
                    Identity.RID);

                AccountInfo = await LG.Data.Members.MemberService.GetAccountInfo(
                    Identity.RID);

                var o = new Entity()
                {
                    RID           = Identity.RID,
                    AccountAction = AccountAction.LoadCreditCard,
                    Events        = new Events()
                    {
                        AccountAction       = AccountAction.LoadCreditCard,
                        AccountActionResult = ActionResult.None
                    },
                    AccountInfo = new AccountInfo()
                    {
                        AccountID = AccountInfo.AccountInfo.AccountID
                    }
                };


                CreditCartList = await LG.Data.Members.AccountService.LoadCreditCards(
                    AccountInfo.AccountInfo.AccountID);

                AccountInfoCCInfo = await LG.Data.Members.AccountService.Load(o);

                MembershipPlan = await LG.Data.Clients.MembershipService.GetInfo(AccountInfo.AccountInfo.MembershipPlanID);

                GroupInfo = await LG.Data.Clients.GroupService.Get(MembershipPlan.GroupID);

                ClientInfo = await LG.Data.Clients.ClientService.GetClientInfo(GroupInfo.ClientRID);

                Products = await LG.Data.Products.ProductService.GetProductsByAccountID(AccountInfo.AccountInfo.AccountID);

                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #4
0
        public async Task<bool> Load()
        {
            if (Identity == null && RolodexItemID == 0) return false;
            if (Identity != null)
            {

                IsAuthenticated = true;

                RolodexItemID = Identity.RID;

                Entity = await LG.Data.Members.MemberService.LoadDetail(
                    Identity.RID);

                PersonInfo = await LG.Data.Shared.EntityService.LoadPersonInfo(
                    Identity.RID);

                AccountInfo = await LG.Data.Members.MemberService.GetAccountInfo(
                    Identity.RID);

                var o = new Entity()
                {
                    RID = Identity.RID,
                    AccountAction = AccountAction.LoadCreditCard,
                    Events = new Events()
                    {
                        AccountAction = AccountAction.LoadCreditCard,
                        AccountActionResult = ActionResult.None
                    },
                    AccountInfo = new AccountInfo()
                    {
                        AccountID = AccountInfo.AccountInfo.AccountID
                    }
                };


                CreditCartList = await LG.Data.Members.AccountService.LoadCreditCards(
                    AccountInfo.AccountInfo.AccountID);

                AccountInfoCCInfo = await LG.Data.Members.AccountService.Load(o);

                MembershipPlan = await LG.Data.Clients.MembershipService.GetInfo(AccountInfo.AccountInfo.MembershipPlanID);

                GroupInfo = await LG.Data.Clients.GroupService.Get(MembershipPlan.GroupID);

                ClientInfo = await LG.Data.Clients.ClientService.GetClientInfo(GroupInfo.ClientRID);

                Products = await LG.Data.Products.ProductService.GetProductsByAccountID(AccountInfo.AccountInfo.AccountID);

                return true;
            }
            else
            {
                return false;
            }
        }
예제 #5
0
        public async Task <bool> Load(long id)
        {
            RolodexItemID = id;

            Entity = await LG.Data.Members.MemberService.LoadDetail(
                id);

            PersonInfo = await LG.Data.Shared.EntityService.LoadPersonInfo(
                id);

            AccountInfo = await LG.Data.Members.MemberService.GetAccountInfo(
                id);


            var o = new Entity()
            {
                RID           = id,
                AccountAction = AccountAction.LoadCreditCard,
                Events        = new Events()
                {
                    AccountAction       = AccountAction.LoadCreditCard,
                    AccountActionResult = ActionResult.None
                },
                AccountInfo = new AccountInfo()
                {
                    AccountID = AccountInfo.AccountInfo.AccountID
                }
            };

            CreditCartList = await LG.Data.Members.AccountService.LoadCreditCards(
                AccountInfo.AccountInfo.AccountID);

            AccountInfoCCInfo = await LG.Data.Members.AccountService.Load(o);

            MembershipPlan = await LG.Data.Clients.MembershipService.GetInfo(
                AccountInfo.AccountInfo.MembershipPlanID);

            GroupInfo = await LG.Data.Clients.GroupService.Get(
                MembershipPlan.GroupID);

            ClientInfo = await LG.Data.Clients.ClientService.GetClientInfo(
                GroupInfo.ClientRID);

            Products = await LG.Data.Products.ProductService.GetProductsByAccountID(
                AccountInfo.AccountInfo.AccountID);

            return(true);
        }
예제 #6
0
        public static async Task <LG.Data.Models.Members.Entity> AccountCreateTask(LG.Data.Models.Members.Entity entity)
        {
            var client = ClientConnection.GetAcsConnection();

            try
            {
                client.Open();
                if (entity.Events.EventAction == Models.Enums.Action.Add)
                {
                    #region [@  Add     @]

                    var response = await client.CreateAccountAsync(new CreateAccountRequest()
                    {
                        AccountInfo_Input = entity.AccountInfoInput,
                        MessageGuid       = Guid.NewGuid(),
                        PropBag           = AccountDataService.PropBag
                    });

                    client.Close();

                    #endregion

                    entity.IsError = false;
                    entity.AccountInfo.AccountID    = response.AccountID;
                    entity.Events.EventActionResult = ActionResult.Success;

                    return(entity);
                }
                else
                {
                    entity.IsError = true;
                    entity.Message = "Need to set EventAction";
                    entity.Events.EventActionResult = ActionResult.Failed;
                    return(entity);
                }
            }
            catch (Exception ex)
            {
                client.Close();
                entity.IsError = true;
                entity.Message = ex.ToString();
                entity.Events.EventActionResult = ActionResult.Failed;
                return(entity);
            }
        }
예제 #7
0
 public static async Task <LG.Data.Models.Members.Entity> InjectMember(LG.Data.Models.Members.Entity entity)
 {
     return(await LG.Data.Core.Shared.EntityDataService.InjectIntoEligibiltiyEntityTask(entity));
 }
예제 #8
0
 public static async Task <LG.Data.Models.Members.Entity> CreateEntity(LG.Data.Models.Members.Entity entity)
 {
     return(await LG.Data.Core.Shared.EntityDataService.CreateEntityTask(entity));
 }
예제 #9
0
 public static async Task <LG.Data.Models.Members.Entity> Phone(LG.Data.Models.Members.Entity entity)
 {
     return(await LG.Data.Shared.EntityService.Phone(entity));
 }
예제 #10
0
 public static async Task <LG.Data.Models.Members.Entity> PersonInfo(LG.Data.Models.Members.Entity entity)
 {
     return(await LG.Data.Shared.EntityService.PersonalInfo(entity));
 }
예제 #11
0
 public static async Task <LG.Data.Models.Members.Entity> Save(LG.Data.Models.Members.Entity entity)
 {
     return(await LG.Data.Core.Members.AccountDataService.AccountSaveTask(entity));
 }
예제 #12
0
 CreateEntity(LG.Data.Models.Members.Entity entity)
 {
     return(await LG.Data.Shared.EntityService.CreateEntity(entity));
 }
예제 #13
0
        //public static async Task<LG.Data.Models.Members.Entity> AccountLoadTask(int AccountID, AccountAction Action)
        //{
        //    var client = ClientConnection.GetAcsConnection();
        //    try
        //    {
        //        client.Open();
        //        switch (Action)
        //        {
        //            case AccountAction.LoadCreditCard:
        //                #region [@  Method     @]

        //                var response = await client.GetCreditCardsOnTheAccountAsync(new GetCreditCardsOnTheAccountRequest()
        //                {
        //                    AccountID = entity.AccountInfo.AccountID,
        //                    MessageGuid = Guid.NewGuid()
        //                });

        //                client.Close();
        //                entity.IsError = false;
        //                entity.Events.AccountActionResult = ActionResult.Success;
        //                entity.CreditCards = response.CreditCards;

        //                return entity;

        //                #endregion
        //                break;
        //            case AccountAction.LoadDependents:
        //                #region [@  Method     @]

        //                var response2 = await client.GetPrimaryAndDependentAccountsAsync(new GetPrimaryAndDependentAccountsRequest()
        //                {
        //                    AccountID = entity.AccountInfo.AccountID,
        //                    MessageGuid = Guid.NewGuid()
        //                });
        //                client.Close();
        //                entity.IsError = false;
        //                entity.Events.AccountActionResult = ActionResult.Success;
        //                entity.Accounts = response2.Accounts;
        //                return entity;

        //                #endregion
        //                break;
        //            default:
        //                client.Close();
        //                entity.IsError = true;
        //                entity.Message = "Failed to Declare AccountAction";
        //                entity.Events.AccountActionResult = ActionResult.Failed;
        //                return entity;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        client.Close();
        //        entity.IsError = true;
        //        entity.Message = ex.ToString();
        //        entity.Events.EventActionResult = ActionResult.Failed;
        //        return entity;
        //    }
        //}
        public static async Task <LG.Data.Models.Members.Entity> AccountSaveTask(LG.Data.Models.Members.Entity entity)
        {
            var client = ClientConnection.GetAcsConnection();

            try
            {
                client.Open();
                switch (entity.Events.AccountAction)
                {
                case AccountAction.IsActive:
                    #region [@  Method     @]

                    var response = await client.SetIsActiveAsync(new SetIsActiveRequest()
                    {
                        AccountID   = entity.AccountInfo.AccountID,
                        IsActive    = entity.AccountInfo.IsActive,
                        MessageGuid = Guid.NewGuid(),
                        PropBag     = AccountDataService.PropBag
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.AccountActionResult = ActionResult.Success;
                    return(entity);

                    #endregion
                    break;

                case AccountAction.ParentAccount:
                    #region [@  Method     @]

                    var response2 = await client.SetParentAccountAsync(new SetParentAccountRequest()
                    {
                        AccountID        = entity.AccountInfo.AccountID,
                        PrimaryAccountID = entity.AccountInfo.PrimaryAccountID,
                        MessageGuid      = Guid.NewGuid(),
                        PropBag          = AccountDataService.PropBag
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.AccountActionResult = ActionResult.Success;
                    return(entity);

                    #endregion
                    break;

                case AccountAction.IsSelfManaged:
                    #region [@  Method     @]

                    var response3 = await client.SetIsSelfManagedAsync(new SetIsSelfManagedRequest()
                    {
                        AccountID     = entity.AccountInfo.AccountID,
                        IsSelfManaged = entity.AccountInfo.IsTesting,
                        MessageGuid   = Guid.NewGuid(),
                        PropBag       = AccountDataService.PropBag
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.AccountActionResult = ActionResult.Success;
                    return(entity);

                    #endregion
                    break;

                case AccountAction.IsAutorenewal:
                    #region [@  Method     @]

                    var response4 = await client.SetIsAutorenewalAsync(new SetIsAutorenewalRequest()
                    {
                        AccountID     = entity.AccountInfo.AccountID,
                        IsAutoRenewal = entity.AccountInfo.IsAutorenewal,
                        MessageGuid   = Guid.NewGuid(),
                        PropBag       = AccountDataService.PropBag
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.AccountActionResult = ActionResult.Success;
                    return(entity);

                    #endregion
                    break;

                case AccountAction.IsTesting:
                    #region [@  Method     @]

                    var response5 = await client.SetIsTestingAsync(new SetIsTestingRequest()
                    {
                        AccountID   = entity.AccountInfo.AccountID,
                        IsTesting   = entity.AccountInfo.IsTesting,
                        MessageGuid = Guid.NewGuid(),
                        PropBag     = AccountDataService.PropBag
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.AccountActionResult = ActionResult.Success;
                    return(entity);

                    #endregion
                    break;

                case AccountAction.MembershipPlan:
                    #region [@  Method     @]

                    var response6 = await client.SetMembershipPlanAsync(new SetMembershipPlanRequest()
                    {
                        AccountID        = entity.AccountInfo.AccountID,
                        MembershipPlanID = entity.AccountInfo.MembershipPlanID,
                        MessageGuid      = Guid.NewGuid(),
                        PropBag          = AccountDataService.PropBag
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.AccountActionResult = ActionResult.Success;
                    return(entity);

                    #endregion
                    break;

                case AccountAction.ExpirationDate:
                    #region [@  Method     @]

                    var response7 = await client.SetExpirationDateAsync(new SetExpirationDateRequest()
                    {
                        AccountID        = entity.AccountInfo.AccountID,
                        DTUTC_Expiration = entity.AccountInfo.DTUTC_Expires,
                        MessageGuid      = Guid.NewGuid(),
                        PropBag          = AccountDataService.PropBag
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.AccountActionResult = ActionResult.Success;
                    return(entity);

                    #endregion
                    break;

                case AccountAction.CreditCard:
                    #region [@  Method     @]

                    var response8 = await client.SaveCreditCardInformationAsync(new SaveCreditCardInformationRequest()
                    {
                        CreditCardInfo_Input = entity.CreditCardInfoInput,
                        MessageGuid          = Guid.NewGuid(),
                        PropBag = AccountDataService.PropBag
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.AccountActionResult = ActionResult.Success;
                    return(entity);

                    #endregion
                    break;

                case AccountAction.AccountInfo:
                    #region [@  Method     @]

                    var response9 = await client.GetAccountInfoAsync(new GetAccountInfoRequest()
                    {
                        AccountID   = entity.AccountInfo.AccountID,
                        RID         = entity.RID,
                        MessageGuid = Guid.NewGuid(),
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.EventActionResult = ActionResult.Success;
                    return(entity);

                    #endregion
                    break;

                default:
                    client.Close();
                    entity.IsError = true;
                    entity.Message = "Failed to Declare AccountAction";
                    entity.Events.AccountActionResult = ActionResult.Failed;
                    return(entity);
                }
            }
            catch (Exception ex)
            {
                client.Close();
                entity.IsError = true;
                entity.Message = ex.ToString();
                entity.Events.EventActionResult = ActionResult.Failed;
                return(entity);
            }
        }
예제 #14
0
        public static async Task <LG.Data.Models.Members.Entity> AccountLoadTask(LG.Data.Models.Members.Entity entity)
        {
            var client = ClientConnection.GetAcsConnection();

            try
            {
                client.Open();
                switch (entity.Events.AccountAction)
                {
                case AccountAction.LoadCreditCard:
                    #region [@  Method     @]

                    var response = await client.GetCreditCardsOnTheAccountAsync(new GetCreditCardsOnTheAccountRequest()
                    {
                        AccountID   = entity.AccountInfo.AccountID,
                        MessageGuid = Guid.NewGuid()
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.AccountActionResult = ActionResult.Success;
                    entity.CreditCards = response.CreditCards;

                    return(entity);

                    #endregion
                    break;

                case AccountAction.LoadDependents:
                    #region [@  Method     @]

                    var response2 = await client.GetPrimaryAndDependentAccountsAsync(new GetPrimaryAndDependentAccountsRequest()
                    {
                        AccountID   = entity.AccountInfo.AccountID,
                        MessageGuid = Guid.NewGuid()
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.AccountActionResult = ActionResult.Success;
                    entity.Accounts = response2.Accounts;
                    return(entity);

                    #endregion
                    break;

                default:
                    client.Close();
                    entity.IsError = true;
                    entity.Message = "Failed to Declare AccountAction";
                    entity.Events.AccountActionResult = ActionResult.Failed;
                    return(entity);
                }
            }
            catch (Exception ex)
            {
                client.Close();
                entity.IsError = true;
                entity.Message = ex.ToString();
                entity.Events.EventActionResult = ActionResult.Failed;
                return(entity);
            }
        }
예제 #15
0
 public static async Task <LG.Data.Models.Members.Entity> Address(LG.Data.Models.Members.Entity entity)
 {
     return(await LG.Data.Core.Shared.EntityDataService.AddressSaveTask(entity));
 }
예제 #16
0
        public static async Task <LG.Data.Models.Members.Entity> PhoneSaveTask(LG.Data.Models.Members.Entity entity)
        {
            var client = ClientConnection.GetEmsConnection();

            try
            {
                client.Open();
                if (entity.Events.EventAction == Models.Enums.Action.Add)
                {
                    #region [@  Add     @]

                    var response = await client.AddPhoneAsync(
                        new AddPhoneRequest
                    {
                        MessageGuid = Guid.NewGuid(),
                        RID         = entity.RID,
                        Phone       = entity.Phones[0],
                        PropBag     = PropBag
                    });

                    client.Close();

                    #endregion

                    entity.IsError = false;
                    entity.Events.EventActionResult = ActionResult.Success;
                    return(entity);
                }
                else
                {
                    #region [@  Update     @]

                    var response = await client.UpdatePhoneAsync(
                        new UpdatePhoneRequest
                    {
                        MessageGuid            = new Guid(),
                        RID                    = entity.RID,
                        NewPhone               = entity.Phones[1],
                        IsPrimary              = entity.Phones[1].PhoneUsages[0].IsPrimary,
                        PhoneIDToUpdate        = entity.Phones[0].ID,
                        NewPhoneUsageEnum      = entity.Phones[1].PhoneUsages[0].PhoneUsageEnum,
                        PhoneUsageEnumToUpdate = entity.Phones[0].PhoneUsages[0].PhoneUsageEnum,
                        PropBag                = PropBag
                    });

                    client.Close();
                    #endregion

                    entity.IsError = false;
                    entity.Events.EventActionResult = ActionResult.Success;
                    return(entity);
                }
            }
            catch (Exception ex)
            {
                client.Close();
                entity.IsError = true;
                entity.Message = ex.ToString();
                entity.Events.EventActionResult = ActionResult.Failed;
                return(entity);
            }
        }
예제 #17
0
        public static async Task <LG.Data.Models.Members.Entity> InjectIntoEligibiltiyEntityTask(LG.Data.Models.Members.Entity entity)
        {
            var client = ClientConnection.GetImsConnection();

            try
            {
                client.Open();
                var response = await client.StoreMemberEligibilityAsync(new StoreMemberEligibilityRequest()
                {
                    MessageGuid                = Guid.NewGuid(),
                    ClientRID                  = entity.ClientRID,
                    EventGUID                  = Guid.NewGuid(),
                    RequestedByRID             = entity.RID,
                    MemberEligibilityDataInput = new MemberEligibilityData_Input()
                    {
                        DTUTC_EffectiveDate = entity.EffectiveDate,
                        CoverageCode        = entity.CoverageCode,
                        GroupNumber         = entity.GroupNumber,
                        DOB                   = entity.PersonInfo.Dob,
                        FName                 = entity.PersonInfo.FName,
                        LName                 = entity.PersonInfo.LName,
                        Gender                = entity.PersonInfo.Gender,
                        MemberNumber          = entity.MemberNumber,
                        DTUTC_TerminationDate = entity.EffectiveDate.AddYears(1).ToUniversalTime(),
                        PhoneNumber           = entity.Phone,
                        EmailAddress          = entity.Email,
                        AddressLine1          = entity.Address.AddressLine1,
                        AddressLine2          = entity.Address.AddressLine2,
                        City                  = entity.Address.City,
                        State                 = entity.Address.State,
                        ZipCode               = entity.Address.ZipCode,
                        CountryCode           = entity.Address.CountryCode,
                    },
                    PropBag = EntityDataService.PropBag
                });

                client.Close();
                entity.IsError = false;
                entity.Events.EventActionResult = ActionResult.Success;
                return(entity);
            }
            catch (Exception ex)
            {
                client.Close();
                entity.IsError = true;
                entity.Message = ex.ToString();
                entity.Events.EventActionResult = ActionResult.Failed;
                return(entity);
            }
        }
예제 #18
0
 public static async Task <LG.Data.Models.Members.Entity> SecurityInfo(LG.Data.Models.Members.Entity entity)
 {
     return(await LG.Data.Core.Shared.EntityDataService.SecurityInfoSaveTask(entity));
 }
예제 #19
0
        public static async Task <LG.Data.Models.Members.Entity> PersonalInfoSaveTask(LG.Data.Models.Members.Entity entity)
        {
            var client = ClientConnection.GetEmsConnection();

            try
            {
                client.Open();
                if (entity.Events.EventAction == Models.Enums.Action.Add)
                {
                    var response = await client.SavePersonInfoAsync(
                        new SavePersonInfoRequest()
                    {
                        MessageGuid = new Guid(),
                        RID         = entity.RID,
                        DOB         = entity.PersonInfo.Dob,
                        FName       = entity.PersonInfo.FName,
                        MName       = entity.PersonInfo.MName,
                        LName       = entity.PersonInfo.LName,
                        Gender      = entity.PersonInfo.Gender,
                        PropBag     = PropBag
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.EventActionResult = ActionResult.Success;
                    return(entity);
                }
                else
                {
                    var response = await client.SavePersonInfoAsync(
                        new SavePersonInfoRequest()
                    {
                        MessageGuid = new Guid(),
                        RID         = entity.RID,
                        DOB         = entity.PersonInfo.Dob,
                        FName       = entity.PersonInfo.FName,
                        MName       = entity.PersonInfo.MName,
                        LName       = entity.PersonInfo.LName,
                        Gender      = entity.PersonInfo.Gender,
                        PropBag     = PropBag
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.EventActionResult = ActionResult.Success;
                    return(entity);
                }
            }
            catch (Exception ex)
            {
                client.Close();
                entity.IsError = true;
                entity.Message = ex.ToString();
                entity.Events.EventActionResult = ActionResult.Failed;
                return(entity);
            }
        }
예제 #20
0
        public async Task<bool> Load(long id)
        {


            RolodexItemID = id;

            Entity = await LG.Data.Members.MemberService.LoadDetail(
                id);

            PersonInfo = await LG.Data.Shared.EntityService.LoadPersonInfo(
                id);

            AccountInfo = await LG.Data.Members.MemberService.GetAccountInfo(
                id);


            var o = new Entity()
            {
                RID = id,
                AccountAction = AccountAction.LoadCreditCard,
                Events = new Events()
                {
                    AccountAction = AccountAction.LoadCreditCard,
                    AccountActionResult = ActionResult.None
                },
                AccountInfo = new AccountInfo()
                {
                    AccountID = AccountInfo.AccountInfo.AccountID
                }

            };
            CreditCartList = await LG.Data.Members.AccountService.LoadCreditCards(
                  AccountInfo.AccountInfo.AccountID);

            AccountInfoCCInfo = await LG.Data.Members.AccountService.Load(o);

            MembershipPlan = await LG.Data.Clients.MembershipService.GetInfo(
                AccountInfo.AccountInfo.MembershipPlanID);

            GroupInfo = await LG.Data.Clients.GroupService.Get(
                MembershipPlan.GroupID);

            ClientInfo = await LG.Data.Clients.ClientService.GetClientInfo(
                GroupInfo.ClientRID);

            Products = await LG.Data.Products.ProductService.GetProductsByAccountID(
                AccountInfo.AccountInfo.AccountID);

            return true;
        }
예제 #21
0
        public static async Task <LG.Data.Models.Members.Entity> SecurityInfoSaveTask(LG.Data.Models.Members.Entity entity)
        {
            var client = ClientConnection.GetAmsConnection();

            try
            {
                client.Open();
                if (entity.Events.EventAction == Models.Enums.Action.Add)
                {
                    var response = await client.CreateLoginAsync(
                        new CreateLoginRequest
                    {
                        MessageGuid           = new Guid(),
                        RID                   = entity.RID,
                        UserName              = entity.LoginInfo.UserName,
                        PlainPassword         = entity.LoginInfo.PlainPassword,
                        IsTemporaryPassword   = entity.LoginInfo.IsTemporaryPassword.HasValue && entity.LoginInfo.IsTemporaryPassword.Value,
                        IsActive              = true,
                        DTUTC_PasswordExpires = new DateTime(1970, 1, 1),
                        PropBag               = PropBag
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.EventActionResult = ActionResult.Success;
                    return(entity);
                }
                else
                {
                    var response = await client.UpdatePasswordAsync(
                        new UpdatePasswordRequest
                    {
                        MessageGuid           = new Guid(),
                        RID                   = entity.RID,
                        Password              = entity.LoginInfo.PlainPassword,
                        IsTemporaryPassword   = entity.LoginInfo.IsTemporaryPassword.HasValue && entity.LoginInfo.IsTemporaryPassword.Value,
                        DTUTC_PasswordExpires = new DateTime(1970, 1, 1),
                        PropBag               = PropBag
                    });

                    client.Close();
                    entity.IsError = false;
                    entity.Events.EventActionResult = ActionResult.Success;
                    return(entity);
                }
            }
            catch (Exception ex)
            {
                client.Close();
                entity.IsError = true;
                entity.Message = ex.ToString();
                entity.Events.EventActionResult = ActionResult.Failed;
                return(entity);
            }
        }