コード例 #1
0
        Store(LG.Data.Models.Enums.BusinessLevel level, LG.Data.Models.Clients.BusinessSettings entity)
        {
            switch (level)
            {
            case BusinessLevel.Client:
                return(await StoreClientLevel(entity));

            case BusinessLevel.Group:
                return(await StoreGroupLevel(entity));

            case BusinessLevel.Membership:
                return(await StoreMembershipPlanLevel(entity));

            case BusinessLevel.All:

                var response = StoreClientLevel(entity); await response;

                var response2 = StoreGroupLevel(entity); await response2;

                var response3 = StoreMembershipPlanLevel(entity); await response3;

                if (response.IsCompleted && response2.IsCompleted && response3.IsCompleted)
                {
                    return(await LoadMembershipLevel(entity));
                }
                else
                {
                    return(null);
                }
            }
            return(null);
        }
コード例 #2
0
        Load(
            LG.Data.Models.Enums.BusinessLevel level,
            LG.Data.Models.Clients.BusinessSettings entity)
        {
            switch (level)
            {
            case BusinessLevel.Client:
                return(await LoadClientLevel(entity));

            case BusinessLevel.Group:
                return(await LoadGroupLevel(entity));

            case BusinessLevel.Membership:
                return(await LoadMembershipLevel(entity));

            default:
                return(await LoadClientLevel(entity));
            }
        }
コード例 #3
0
        public static async Task <LG.Data.Models.Clients.BusinessSettings> Store(
            LG.Data.Models.Clients.BusinessSettings entity, LG.Data.Models.Enums.BusinessLevel level)
        {
            var client   = LG.Services.ClientConnection.GetBscsConnection();
            var response = await client.StoreBusinessSettingAsync(CreateRequest(entity, level));

            return(new LG.Data.Models.Clients.BusinessSettings()
            {
                ClientRID = entity.ClientRID,
                GroupRID = entity.GroupRID,
                MembershipPlanID = entity.MembershipPlanID,
                CorporationRID = entity.CorporationRID,
                FMPM = entity.FMPM,
                PMPM = entity.PMPM,
                BillingType = entity.BillingType,
                IsActive = entity.IsActive,
                IsError = response.ReturnStatus.IsError,
                Message = response.ReturnStatus.GeneralMessage
            });
        }
コード例 #4
0
        internal static StoreBusinessSettingRequest CreateRequest(LG.Data.Models.Clients.BusinessSettings entity,
                                                                  LG.Data.Models.Enums.BusinessLevel level)
        {
            switch (level)
            {
            case BusinessLevel.Client:
                return(new StoreBusinessSettingRequest()
                {
                    MessageGuid = Guid.NewGuid(),
                    ClientRID = entity.ClientRID,
                    PropBag = entity.ProgBag,
                    IsActive = entity.IsActive,
                    FMPM = entity.FMPM,
                    PMPM = entity.PMPM,
                    BillingType = entity.BillingType,
                    CorporationRID = entity.CorporationRID,
                });

            case BusinessLevel.Group:
                return(new StoreBusinessSettingRequest()
                {
                    MessageGuid = Guid.NewGuid(),
                    ClientRID = entity.ClientRID,
                    PropBag = entity.ProgBag,
                    IsActive = entity.IsActive,
                    FMPM = entity.FMPM,
                    PMPM = entity.PMPM,
                    BillingType = entity.BillingType,
                    CorporationRID = entity.CorporationRID,
                    GroupRID = entity.GroupRID
                });

            case BusinessLevel.Membership:
                return(new StoreBusinessSettingRequest()
                {
                    MessageGuid = Guid.NewGuid(),
                    ClientRID = entity.ClientRID,
                    PropBag = entity.ProgBag,
                    IsActive = entity.IsActive,
                    FMPM = entity.FMPM,
                    PMPM = entity.PMPM,
                    BillingType = entity.BillingType,
                    CorporationRID = entity.CorporationRID,
                    GroupRID = entity.GroupRID,
                    MembershipPlanID = entity.MembershipPlanID
                });

            default:
                return(new StoreBusinessSettingRequest()
                {
                    MessageGuid = Guid.NewGuid(),
                    ClientRID = entity.ClientRID,
                    PropBag = entity.ProgBag,
                    IsActive = entity.IsActive,
                    FMPM = entity.FMPM,
                    PMPM = entity.PMPM,
                    BillingType = entity.BillingType,
                    CorporationRID = entity.CorporationRID,
                    GroupRID = entity.GroupRID,
                    MembershipPlanID = entity.MembershipPlanID
                });
            }
        }