Example #1
0
        UpdateGroupLogo(LG.Data.Models.Clients.Group group)
        {
            var client = ClientConnection.GetGmsConnection();

            try
            {
                client.Open();
                var response = await client.UpdateGroupPathToLogoImageAsync(new UpdateGroupPathToLogoImageRequest()
                {
                    MessageGuid     = Guid.NewGuid(),
                    RID             = group.GroupRID,
                    PathToLogoImage = group.LogoUrl,
                });

                client.Close();
                return(new LG.Data.Models.Clients.Group()
                {
                    IsError = response.ReturnStatus.IsError,
                    Message = response.ReturnStatus.GeneralMessage,
                    GroupRID = group.GroupRID,
                    LogoUrl = group.LogoUrl
                });
            }
            catch (Exception ex)
            {
                client.Close();
                return(new LG.Data.Models.Clients.Group()
                {
                    IsError = true,
                    Message = ex.ToString(),
                    GroupRID = group.GroupRID,
                    LogoUrl = group.LogoUrl
                });
            }
        }
Example #2
0
        UpdateGroupActivationUrl(LG.Data.Models.Clients.Group group)
        {
            var client = ClientConnection.GetGmsConnection();

            try
            {
                client.Open();
                var response = await client.UpdateActivationURLAsync(new UpdateActivationURLRequest()
                {
                    MessageGuid   = Guid.NewGuid(),
                    RID           = group.GroupRID,
                    ActivationURL = group.ActivationUrl,
                });

                client.Close();
                return(new LG.Data.Models.Clients.Group()
                {
                    IsError = response.ReturnStatus.IsError,
                    Message = response.ReturnStatus.GeneralMessage,
                    GroupRID = group.GroupRID,
                    ActivationUrl = group.ActivationUrl
                });
            }
            catch (Exception ex)
            {
                client.Close();
                return(new LG.Data.Models.Clients.Group
                {
                    IsError = true,
                    Message = ex.Message.ToString(CultureInfo.InvariantCulture),
                    GroupRID = group.GroupRID,
                    ActivationUrl = group.ActivationUrl
                });
            }
        }
Example #3
0
        UpdateIsTesting(LG.Data.Models.Clients.Group group)
        {
            var client = ClientConnection.GetGmsConnection();

            try
            {
                client.Open();
                var response = await client.SetGroupIsTestingStatusAsync(new SetGroupIsTestingStatusRequest
                {
                    PropBag     = PropBag,
                    RID         = group.GroupRID,
                    IsTesting   = group.IsTesting,
                    MessageGuid = Guid.NewGuid(),
                });

                client.Close();
                return(new LG.Data.Models.Clients.Group()
                {
                    IsError = response.ReturnStatus.IsError,
                    Message = response.ReturnStatus.GeneralMessage,
                    GroupRID = group.GroupRID,
                    IsTesting = group.IsTesting,
                });
            }
            catch (Exception ex)
            {
                client.Close();
                return(new LG.Data.Models.Clients.Group
                {
                    IsError = true,
                    Message = ex.Message.ToString(CultureInfo.InvariantCulture)
                });
            }
        }
Example #4
0
 InitializeBussinsessSettingsPerGroup(LG.Data.Models.Clients.Group group)
 {
     return(new LG.Data.Models.Clients.BusinessSettings()
     {
         FMPM = 0M,
         PMPM = 0M,
         IsActive = group.IsActive,
         ClientRID = group.ClientRID,
         GroupRID = group.GroupRID,
         CorporationRID = group.CorporationRID,
         MembershipPlanID = 0
     });
 }
Example #5
0
        Create(LG.Data.Models.Clients.Group group)
        {
            var client = ClientConnection.GetGmsConnection();

            try
            {
                client.Open();
                var response = await client.CreateGroupAsync(
                    new CreateGroupRequest()
                {
                    MessageGuid = Guid.NewGuid(),
                    Group       = new LG.Services.GMS.NewGroupInput()
                    {
                        ClientRID       = group.ClientRID,
                        GroupName       = group.GroupName,
                        GroupNumber     = group.GroupNumber,
                        IsActive        = group.IsActive,
                        IsTesting       = group.IsTesting,
                        ActivationURL   = group.ActivationUrl,
                        PathToLogoImage = group.LogoUrl
                    },
                    PropBag = PropBag
                });

                client.Close();

                return(new LG.Data.Models.Clients.Group()
                {
                    IsError = response.ReturnStatus.IsError,
                    Message = response.ReturnStatus.GeneralMessage,
                    GroupRID = response.GroupRID,
                    ClientRID = group.ClientRID,
                    GroupName = group.GroupName,
                    GroupNumber = group.GroupNumber,
                    ActivationUrl = group.ActivationUrl
                });
            }
            catch (Exception ex)
            {
                client.Close();
                return(new LG.Data.Models.Clients.Group
                {
                    IsError = true,
                    Message = ex.Message.ToString(CultureInfo.InvariantCulture)
                });
            }
        }
Example #6
0
        void InitializeBussinsessSettingsPerMembership(
            ref List <BusinessSettings> list,
            LG.Data.Models.Clients.MembershipPlan item,
            LG.Data.Models.Clients.Group group)
        {
            var businessSettings
                = new LG.Data.Models.Clients.BusinessSettings()
                {
                FMPM             = 0M,
                PMPM             = 0M,
                IsActive         = true,
                ClientRID        = group.ClientRID,
                GroupRID         = group.GroupRID,
                CorporationRID   = group.CorporationRID,
                MembershipPlanID = item.MembershipPlanID,
                };

            list.Add(businessSettings);
        }
Example #7
0
        UpdateGroupInformation(LG.Data.Models.Clients.Group group)
        {
            var response
                = UpdateName(group);
            await response;

            var response2
                = UpdateNumber(group);

            await response2;

            var response3
                = UpdateIsActive(group);

            await response3;

            var response4
                = UpdateIsTesting(group);

            await response4;

            var response5
                = UpdateActivationUrl(group);
            await response5;

            var responseSettings0 = LG.Data.Business.Settings.Store(
                BusinessLevel.Group, InitializeBussinsessSettingsPerGroup(group));


            await responseSettings0;

            if (response.IsCompleted &&
                response2.IsCompleted &&
                response3.IsCompleted &&
                response4.IsCompleted &&
                response5.IsCompleted &&
                responseSettings0.IsCompleted)
            {
                return(await LG.Data.Core.Clients.GroupDataService.Get(group.GroupRID));
            }
            return(null);
        }
Example #8
0
        CreateGroupMembershipPlans(LG.Data.Models.Clients.Group group)
        {
            var plans = new LG.Data.Utilities.Clients.GenericMembershipPlans(
                group.GroupRID);

            var response =
                LG.Data.Core.Clients.MembershipDataService.CreateMembershipPlans(plans.EmployeeBasic);

            await response;

            var response2 =
                LG.Data.Core.Clients.MembershipDataService.CreateMembershipPlans(plans.EmployeeSpouse);

            await response2;

            var response3 =
                LG.Data.Core.Clients.MembershipDataService.CreateMembershipPlans(plans.EmployeeChildren);

            await response3;

            var response4 =
                LG.Data.Core.Clients.MembershipDataService.CreateMembershipPlans(plans.EmployeeFamily);

            await response4;

            if (response.IsCompleted &&
                response2.IsCompleted &&
                response3.IsCompleted &&
                response4.IsCompleted)
            {
                var list = new List <BusinessSettings>();

                InitializeBussinsessSettingsPerMembership(ref list,
                                                          response.Result, group);

                InitializeBussinsessSettingsPerMembership(ref list,
                                                          response2.Result, group);

                InitializeBussinsessSettingsPerMembership(ref list,
                                                          response3.Result, group);

                InitializeBussinsessSettingsPerMembership(ref list,
                                                          response4.Result, group);

                var responseSettings0 = LG.Data.Business.Settings.Store(
                    BusinessLevel.Membership, list[0]);
                await responseSettings0;

                var responseSettings1 = LG.Data.Business.Settings.Store(
                    BusinessLevel.Membership, list[1]);
                await responseSettings1;

                var responseSettings2 = LG.Data.Business.Settings.Store(
                    BusinessLevel.Membership, list[2]);
                await responseSettings2;

                var responseSettings3 = LG.Data.Business.Settings.Store(
                    BusinessLevel.Membership, list[3]);

                await responseSettings3;

                if (responseSettings0.IsCompleted &&
                    responseSettings1.IsCompleted &&
                    responseSettings2.IsCompleted &&
                    responseSettings3.IsCompleted)
                {
                    return(await LG.Data.Core.Clients.GroupDataService.Get(group.GroupRID));
                }
            }
            return(null);
        }
Example #9
0
 CreateGroup(LG.Data.Models.Clients.Group group)
 {
     return(await LG.Data.Core.Clients.GroupDataService.Create(group));
 }
Example #10
0
 UpdateActivationUrl(LG.Data.Models.Clients.Group group)
 {
     return(await LG.Data.Core.Clients.GroupDataService.UpdateGroupActivationUrl(group));
 }
Example #11
0
 UpdateLogo(LG.Data.Models.Clients.Group group)
 {
     return(await LG.Data.Core.Clients.GroupDataService.UpdateGroupLogo(group));
 }
Example #12
0
 UpdateNumber(LG.Data.Models.Clients.Group group)
 {
     return(await LG.Data.Core.Clients.GroupDataService.UpdateGroupNumber(group));
 }
Example #13
0
 UpdateIsTesting(LG.Data.Models.Clients.Group group)
 {
     return(await LG.Data.Core.Clients.GroupDataService.UpdateIsActive(group));
 }