/// <summary>
        /// Adds the contact benefit.
        /// </summary>
        /// <param name="contactBenefit">The contact benefit.</param>
        /// <returns></returns>
        public Response <ContactBenefitViewModel> AddContactBenefit(ContactBenefitViewModel contactBenefit)
        {
            string apiUrl   = baseRoute + "AddContactBenefit";
            var    response = communicationManager.Post <ContactBenefitModel, Response <ContactBenefitModel> >(contactBenefit.ToModel(), apiUrl);

            return(response.ToViewModel());
        }
示例#2
0
        public void UpdateContactBenefit_Failed()
        {
            //Arrange
            contactBenefitViewModel = new ContactBenefitViewModel
            {
                ContactID              = 0,
                ContactPayorID         = 1,
                ContactPayorRank       = 2,
                PolicyHolderFirstName  = "PHFirstName",
                PolicyHolderMiddleName = "PHMiddleName",
                PolicyHolderLastName   = "PHLastName",
                PolicyHolderSuffixID   = 99,
                ForceRollback          = true
            };

            //Act
            var modelResponse = controller.UpdateContactBenefit(contactBenefitViewModel);

            //Assert
            Assert.IsNotNull(modelResponse);
            Assert.IsTrue(modelResponse.ResultCode != 0);
        }
示例#3
0
        public void AddContactBenefit_Failed()
        {
            //Arrange
            contactBenefitViewModel = new ContactBenefitViewModel
            {
                ContactID              = 0,
                ContactPayorID         = 0,
                PayorID                = 7,
                PayorPlanID            = 200,
                PolicyHolderFirstName  = "PHFirstName",
                PolicyHolderMiddleName = "PHMiddleName",
                PolicyHolderLastName   = "PHLastName",
                PolicyHolderSuffixID   = 99,
                ForceRollback          = true
            };

            //Act
            var response = AddContactBenefit();

            //Assert
            Assert.IsNotNull(response);
            Assert.IsTrue(response.ResultCode != 0);
        }
示例#4
0
 public Response <ContactBenefitViewModel> UpdateContactBenefit(ContactBenefitViewModel contactBenefit)
 {
     return(_contactBenefitRepository.UpdateContactBenefit(contactBenefit));
 }
        /// <summary>
        /// To the view model.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <returns></returns>
        public static ContactBenefitViewModel ToViewModel(this  ContactBenefitModel entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var model = new ContactBenefitViewModel
            {
                ContactPayorID          = entity.ContactPayorID,
                ContactID               = entity.ContactID,
                PayorID                 = entity.PayorID,
                PayorPlanID             = entity.PayorPlanID,
                PayorGroupID            = entity.PayorGroupID,
                PolicyHolderID          = entity.PolicyHolderID,
                PolicyHolderName        = entity.PolicyHolderName,
                PayorAddressID          = entity.PayorAddressID,
                PolicyID                = entity.PolicyID,
                Deductible              = entity.Deductible,
                Copay                   = entity.Copay,
                CoInsurance             = entity.CoInsurance,
                EffectiveDate           = entity.EffectiveDate,
                ExpirationDate          = entity.ExpirationDate,
                PayorExpirationReasonID = entity.PayorExpirationReasonID,
                ExpirationReason        = entity.ExpirationReason,
                AddRetroDate            = entity.AddRetroDate,
                ContactPayorRank        = entity.ContactPayorRank,

                AddressID     = entity.AddressID,
                AddressTypeID = entity.AddressTypeID,
                Line1         = entity.Line1,
                Line2         = entity.Line2,
                City          = entity.City,
                StateProvince = entity.StateProvince,
                County        = entity.County,
                Zip           = entity.Zip,

                PlanName = entity.PlanName,
                PlanID   = entity.PlanID,

                GroupName = entity.GroupName,
                GroupID   = entity.GroupID,

                PolicyHolderFirstName  = entity.PolicyHolderFirstName,
                PolicyHolderMiddleName = entity.PolicyHolderMiddleName,
                PolicyHolderLastName   = entity.PolicyHolderLastName,
                PolicyHolderEmployer   = entity.PolicyHolderEmployer,
                PolicyHolderSuffixID   = entity.PolicyHolderSuffixID,
                PayorName                   = entity.PayorName,
                PayorCode                   = entity.PayorCode,
                ModifiedOn                  = entity.ModifiedOn,
                BillingFirstName            = entity.BillingFirstName,
                BillingMiddleName           = entity.BillingMiddleName,
                BillingLastName             = entity.BillingLastName,
                BillingSuffixID             = entity.BillingSuffixID,
                AdditionalInformation       = entity.AdditionalInformation,
                ElectronicPayorID           = entity.ElectronicPayorID,
                HasPolicyHolderSameCardName = entity.HasPolicyHolderSameCardName
            };

            return(model);
        }
        /// <summary>
        /// To the model.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns></returns>
        public static ContactBenefitModel ToModel(this ContactBenefitViewModel model)
        {
            if (model == null)
            {
                return(null);
            }

            var entity = new ContactBenefitModel
            {
                ContactPayorID          = model.ContactPayorID,
                ContactID               = model.ContactID,
                PayorID                 = model.PayorID,
                PayorPlanID             = model.PayorPlanID,
                PayorGroupID            = model.PayorGroupID,
                PolicyHolderID          = model.PolicyHolderID,
                PolicyHolderName        = model.PolicyHolderName,
                PayorAddressID          = model.PayorAddressID,
                PolicyID                = model.PolicyID,
                Deductible              = model.Deductible,
                Copay                   = model.Copay,
                CoInsurance             = model.CoInsurance,
                EffectiveDate           = model.EffectiveDate,
                ExpirationDate          = model.ExpirationDate,
                PayorExpirationReasonID = model.PayorExpirationReasonID,
                ExpirationReason        = model.ExpirationReason,
                AddRetroDate            = model.AddRetroDate,
                ContactPayorRank        = model.ContactPayorRank,

                AddressID     = model.AddressID,
                AddressTypeID = model.AddressTypeID,
                Line1         = model.Line1,
                Line2         = model.Line2,
                City          = model.City,
                StateProvince = model.StateProvince,
                County        = model.County,
                Zip           = !string.IsNullOrEmpty(model.Zip) ? model.Zip : null,
                PlanName      = model.PlanName,
                PlanID        = model.PlanID,

                GroupName = model.GroupName,
                GroupID   = model.GroupID,

                PolicyHolderFirstName  = model.PolicyHolderFirstName,
                PolicyHolderMiddleName = model.PolicyHolderMiddleName,
                PolicyHolderLastName   = model.PolicyHolderLastName,
                PolicyHolderEmployer   = model.PolicyHolderEmployer,
                PolicyHolderSuffixID   = model.PolicyHolderSuffixID,

                PayorName                   = model.PayorName,
                PayorCode                   = model.PayorCode,
                ForceRollback               = model.ForceRollback,
                ModifiedOn                  = model.ModifiedOn,
                BillingFirstName            = model.BillingFirstName,
                BillingMiddleName           = model.BillingMiddleName,
                BillingLastName             = model.BillingLastName,
                BillingSuffixID             = model.BillingSuffixID,
                AdditionalInformation       = model.AdditionalInformation,
                ElectronicPayorID           = model.ElectronicPayorID,
                HasPolicyHolderSameCardName = model.HasPolicyHolderSameCardName
            };

            return(entity);
        }