Exemple #1
0
        UpdateCoverageCode(LG.Data.Models.Clients.MembershipPlan plan)
        {
            var client = ClientConnection.GetMpsConnection();

            try
            {
                client.Open();
                var response = await client.UpdateCoverageCodeAsync(
                    new UpdateCoverageCodeRequest()
                {
                    MessageGuid      = Guid.NewGuid(),
                    CoverageCode     = plan.CoverageCode,
                    MembershipPlanID = plan.MembershipPlanID,
                    PropBag          = PropBag
                });

                client.Close();
                plan.IsError = response.ReturnStatus.IsError;
                plan.Message = response.ReturnStatus.GeneralMessage;
                return(plan);
            }
            catch (Exception ex)
            {
                client.Close();
                return(new LG.Data.Models.Clients.MembershipPlan
                {
                    MembershipPlanID = 0,
                    IsError = true,
                    Message = ex.Message
                });
            }
        }
 public GenericMembershipPlans(System.Int64 groupID)
 {
     EmployeeBasic = new MembershipPlan()
     {
         IsActive = true,
         GroupID = groupID,
         PerMemberPerMonth = 0M,
         FamilyMemberPerMonth = 0M,
         BillingType = BillingTypeEnum.PerMemberPerMonth,
         CoverageCode = LG.Data.Models.Enums.CoverageCode.EE.ToString(),
         MembershipLabel = GetLabel(LG.Data.Models.Enums.CoverageCode.EE),
     };
     EmployeeSpouse = new MembershipPlan()
     {
         IsActive = true,
         GroupID = groupID,
         PerMemberPerMonth = 0M,
         FamilyMemberPerMonth = 0M,
         BillingType = BillingTypeEnum.PerMemberPerMonth,
         CoverageCode = LG.Data.Models.Enums.CoverageCode.ES.ToString(),
         MembershipLabel = GetLabel(LG.Data.Models.Enums.CoverageCode.ES),
     };
     EmployeeChildren = new MembershipPlan()
     {
         IsActive = true,
         GroupID = groupID,
         PerMemberPerMonth = 0M,
         FamilyMemberPerMonth = 0M,
         BillingType = BillingTypeEnum.PerEmployeePerMonth,
         CoverageCode = LG.Data.Models.Enums.CoverageCode.EC.ToString(),
         MembershipLabel = GetLabel(LG.Data.Models.Enums.CoverageCode.EC),
     };
     EmployeeFamily = new MembershipPlan()
     {
         IsActive = true,
         GroupID = groupID,
         PerMemberPerMonth = 0M,
         FamilyMemberPerMonth = 0M,
         BillingType = BillingTypeEnum.PerMemberPerMonth,
         CoverageCode = LG.Data.Models.Enums.CoverageCode.FAM.ToString(),
         MembershipLabel = GetLabel(LG.Data.Models.Enums.CoverageCode.FAM),
     };
 }
Exemple #3
0
 public GenericMembershipPlans(System.Int64 groupID)
 {
     EmployeeBasic = new MembershipPlan()
     {
         IsActive             = true,
         GroupID              = groupID,
         PerMemberPerMonth    = 0M,
         FamilyMemberPerMonth = 0M,
         BillingType          = BillingTypeEnum.PerMemberPerMonth,
         CoverageCode         = LG.Data.Models.Enums.CoverageCode.EE.ToString(),
         MembershipLabel      = GetLabel(LG.Data.Models.Enums.CoverageCode.EE),
     };
     EmployeeSpouse = new MembershipPlan()
     {
         IsActive             = true,
         GroupID              = groupID,
         PerMemberPerMonth    = 0M,
         FamilyMemberPerMonth = 0M,
         BillingType          = BillingTypeEnum.PerMemberPerMonth,
         CoverageCode         = LG.Data.Models.Enums.CoverageCode.ES.ToString(),
         MembershipLabel      = GetLabel(LG.Data.Models.Enums.CoverageCode.ES),
     };
     EmployeeChildren = new MembershipPlan()
     {
         IsActive             = true,
         GroupID              = groupID,
         PerMemberPerMonth    = 0M,
         FamilyMemberPerMonth = 0M,
         BillingType          = BillingTypeEnum.PerEmployeePerMonth,
         CoverageCode         = LG.Data.Models.Enums.CoverageCode.EC.ToString(),
         MembershipLabel      = GetLabel(LG.Data.Models.Enums.CoverageCode.EC),
     };
     EmployeeFamily = new MembershipPlan()
     {
         IsActive             = true,
         GroupID              = groupID,
         PerMemberPerMonth    = 0M,
         FamilyMemberPerMonth = 0M,
         BillingType          = BillingTypeEnum.PerMemberPerMonth,
         CoverageCode         = LG.Data.Models.Enums.CoverageCode.FAM.ToString(),
         MembershipLabel      = GetLabel(LG.Data.Models.Enums.CoverageCode.FAM),
     };
 }
Exemple #4
0
        CreateMembershipPlans(LG.Data.Models.Clients.MembershipPlan plan)
        {
            var client = ClientConnection.GetMpsConnection();

            try
            {
                client.Open();
                var response = await client.CreateMembershipPlanAsync(new CreateMembershipPlanRequest()
                {
                    MessageGuid    = Guid.NewGuid(),
                    MembershipPlan = new NewMembershipPlanInput()
                    {
                        GroupRID     = plan.GroupID,
                        IsActive     = plan.IsActive,
                        Label        = plan.MembershipLabel,
                        CoverageCode = plan.CoverageCode,
                        BillingType  = plan.BillingType,
                        PMPM         = plan.PerMemberPerMonth,
                        FMPM         = plan.FamilyMemberPerMonth,
                    },
                    PropBag = PropBag
                });

                client.Close();
                plan.MembershipPlanID = response.MembershipPlanID;
                plan.IsError          = response.ReturnStatus.IsError;
                plan.Message          = response.ReturnStatus.GeneralMessage;
                return(plan);
            }
            catch (Exception ex)
            {
                client.Close();
                return(new LG.Data.Models.Clients.MembershipPlan
                {
                    MembershipPlanID = 0,
                    IsError = true,
                    Message = ex.Message
                });
            }
        }
Exemple #5
0
        Update(LG.Data.Models.Clients.MembershipPlan plan)
        {
            var   response = LG.Data.Clients.MembershipService.UpdateIsActive(plan);
            await response;

            var   response2 = LG.Data.Clients.MembershipService.UpdateCoverageCode(plan);
            await response2;

            var   response3 = LG.Data.Clients.MembershipService.UpdateMembershipName(plan);
            await response3;

            if (response.IsCompleted &&
                response2.IsCompleted &&
                response3.IsCompleted)
            {
                var businessSettings
                    = new LG.Data.Models.Clients.BusinessSettings()
                    {
                    FMPM             = plan.FamilyMemberPerMonth,
                    PMPM             = plan.PerMemberPerMonth,
                    IsActive         = plan.IsActive,
                    ClientRID        = plan.ClientRID,
                    GroupRID         = plan.GroupRID,
                    CorporationRID   = plan.CorporationRID,
                    MembershipPlanID = plan.MembershipPlanID,
                    };
                var response4 = LG.Data.Business.Settings.Store(
                    BusinessLevel.Membership, businessSettings);

                await response4;
                if (response4.IsCompleted)
                {
                    return(await LG.Data.Clients.GroupService.Get(plan.GroupRID));
                }
            }
            return(null);
        }
Exemple #6
0
 UpdateCoverageCode(LG.Data.Models.Clients.MembershipPlan plan)
 {
     return(await LG.Data.Core.Clients.MembershipDataService.UpdateCoverageCode(plan));
 }