public static async Task <LG.Data.Models.Clients.BusinessSettings> Store( LG.Data.Models.Clients.BusinessSettings entity) { var client = LG.Services.ClientConnection.GetBscsConnection(); var response = await client.StoreBusinessSettingAsync(new StoreBusinessSettingRequest() { MessageGuid = new Guid(), 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 }); return(new LG.Data.Models.Clients.BusinessSettings() { ClientRID = entity.ClientRID, GroupRID = entity.GroupRID, MembershipPlanID = entity.MembershipPlanID, CorporationRID = entity.CorporationRID, BillingType = entity.BillingType, FMPM = entity.FMPM, PMPM = entity.PMPM, IsActive = entity.IsActive, IsError = response.ReturnStatus.IsError, Message = response.ReturnStatus.GeneralMessage }); }
public static async Task <LG.Data.Models.Clients.BusinessSettings> Load( LG.Data.Models.Clients.BusinessSettings entity) { var client = LG.Services.ClientConnection.GetBscsConnection(); var response = await client.LoadBusinessSettingsAsync(new LoadBusinessSettingsRequest() { MessageGuid = new Guid(), GroupRID = entity.GroupRID, ClientRID = entity.ClientRID, MembershipPlanID = entity.MembershipPlanID, CorporationRID = entity.CorporationRID }); return(new LG.Data.Models.Clients.BusinessSettings() { ClientRID = entity.ClientRID, GroupRID = entity.GroupRID, CorporationRID = entity.CorporationRID, MembershipPlanID = entity.MembershipPlanID, FMPM = response.BusinessSettings.FMPM.HasValue ? response.BusinessSettings.FMPM.Value : 0M, PMPM = response.BusinessSettings.PMPM.HasValue ? response.BusinessSettings.PMPM.Value : 0M, IsActive = entity.IsActive, BillingType = response.BusinessSettings.BillingType, IsError = response.ReturnStatus.IsError, Message = response.ReturnStatus.GeneralMessage }); }
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); }
LoadClientLevel(LG.Data.Models.Clients.BusinessSettings entity) { var response = LG.Data.Core.Clients.BusinessSettings.Load( new LG.Data.Models.Clients.BusinessSettings() { ClientRID = entity.ClientRID, CorporationRID = entity.CorporationRID }); await response; return(response.Result); }
LoadMembershipLevel(LG.Data.Models.Clients.BusinessSettings entity) { var response = LG.Data.Core.Clients.BusinessSettings.Load( new LG.Data.Models.Clients.BusinessSettings() { MembershipPlanID = entity.MembershipPlanID, ClientRID = entity.ClientRID, GroupRID = entity.GroupRID, CorporationRID = entity.CorporationRID }); await response; return(response.Result); }
internal static async Task <LG.Data.Models.Clients.BusinessSettings> StoreClientLevel( LG.Data.Models.Clients.BusinessSettings entity) { var response = LG.Data.Core.Clients.BusinessSettings.Store( new LG.Data.Models.Clients.BusinessSettings() { ClientRID = entity.ClientRID, CorporationRID = entity.CorporationRID, IsActive = true, FMPM = entity.FMPM, PMPM = entity.PMPM, BillingType = entity.BillingType, }, BusinessLevel.Client); await response; return(entity); }
internal static async Task <LG.Data.Models.Clients.BusinessSettings> StoreMembershipPlanLevel( LG.Data.Models.Clients.BusinessSettings entity) { var response = LG.Data.Core.Clients.BusinessSettings.Store( new LG.Data.Models.Clients.BusinessSettings() { GroupRID = entity.GroupRID, ClientRID = entity.ClientRID, CorporationRID = entity.CorporationRID, MembershipPlanID = entity.MembershipPlanID, IsActive = true, FMPM = entity.FMPM, PMPM = entity.PMPM, BillingType = entity.BillingType }); await response; return(entity); }
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)); } }
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 }); }
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; }
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); }
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 }); } }