Exemple #1
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;
        }
Exemple #2
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);
        }