Пример #1
0
        private Xrae.UnderwritingProfile GetProfile()
        {
            int bDay = System.Convert.ToInt32(this.sltBDay.Value.ToString().Trim());
            //int bDay = System.Convert.ToInt32("15");
            int    bMonth  = System.Convert.ToInt32(this.sltBMonth.Value.ToString().Trim());
            int    bYear   = System.Convert.ToInt32(this.sltByear.Value.ToString().Trim());
            object sexMale = null;
            var    smoker  = false;

            if (this.rdSmokerN.Attributes["checked"] != null)
            {
                smoker = false;
            }
            if (this.rdSmokerY.Attributes["checked"] != null)
            {
                smoker = true;
            }
            if (this.rdSexMale.Attributes["checked"] != null)
            {
                sexMale = Xrae.Gender.Male;
            }
            if (this.rdSexFemale.Attributes["checked"] != null)
            {
                sexMale = Xrae.Gender.Female;
            }
            int faceAmount = System.Convert.ToInt32(txtFaceAmount.Text.Trim());
            //create api underwriting profile instance
            var profile = new Xrae.UnderwritingProfile
            {
                DateOfBirth = new Xrae.DateLongType {
                    Month = bMonth, Day = bDay, Year = bYear
                },
                Gender     = (Xrae.Gender)sexMale,
                TobaccoUse = new Xrae.TobaccoProfile {
                    EverUse = smoker
                },
                PolicyDetails = new Xrae.PolicyProfile {
                    FaceAmount = faceAmount, ProductType = Xrae.ProductType.Term, TermLengths = new int[1] {
                        15
                    }
                },
                //PhysicalBuild = new Xrae.BuildProfile { HeightFeet = 5, HeightInches = 6, WeightPounds = 232 },
            };



            var proxyCL   = new Xrae.XraeDirectApiClient();
            var profileCL = proxyCL.GetCaseByKey("B035CBDD7E4F2F60");
            var param     = new Xrae.UpdateCaseRequest
            {
                CaseKey = "B035CBDD7E4F2F60",
                //use key returned by AddCase operation,

                //only required if changed
                SubjectProfile = profile
            };

            Xrae.UpdateCaseResult resultCL = proxyCL.UpdateCase(param);
            return(profile);
        }