コード例 #1
0
        protected void ApplyNow_OnClick(object sender, EventArgs e)
        {
            var s = new CreditCardApplicationServiceReference.CreditCardApplicationServiceClient();

            var a = new CreditCardApplicationServiceReference.CreditCardApplication()
            {
                ApplicantName              = Name.Text,
                ApplicantAgeInYears        = int.Parse(Age.Text),
                AirlineFrequentFlyerNumber = AirlineRewardNumber.Text
            };
            var result = s.SubmitApplication(a);

            if (result.ValidationErrors.Any())
            {
                ShowErrors(result.ValidationErrors);
            }
            else if (result.ReferenceNumber.HasValue)
            {
                RedirectToApplicationAcceptedPage(result.ReferenceNumber.Value);
            }
            else
            {
                RedirectToApplicationRejectedPage();
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var s = new CreditCardApplicationServiceReference.CreditCardApplicationServiceClient();

            var refNum = Request.QueryString["ref"];

            var name = s.GetSuccesfulApplicantsName(int.Parse(refNum));

            Name.InnerText   = name;
            RefNum.InnerText = refNum;
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var s = new CreditCardApplicationServiceReference.CreditCardApplicationServiceClient();

            var refNum = Request.QueryString["ref"];

            var name = s.GetSuccesfulApplicantsName(int.Parse(refNum));

            Name.InnerText = name;
            RefNum.InnerText = refNum;
        }
        private SubmissionResult SubmitAValidApplication()
        {
            var sut = new CreditCardApplicationServiceReference.CreditCardApplicationServiceClient();

            var a = new CreditCardApplication
            {
                ApplicantName = ApplicantName,
                ApplicantAgeInYears = 30,
                AirlineFrequentFlyerNumber = "A1234567"
            };

            return sut.SubmitApplication(a);
        }
        private string GetApplicantName(int refNumber)
        {
            var sut = new CreditCardApplicationServiceReference.CreditCardApplicationServiceClient();

            return sut.GetSuccesfulApplicantsName(refNumber);
        }