private void createSponsorship(Guid constituentId)
        {
            foreach (DataRow dr in this.cartData.Rows)
            {
                DataFormLoadRequest request = SponsorshipAddForm.CreateLoadRequest(this.API.AppFxWebServiceProvider);
                request.FormID = new Guid("8a73db30-db6b-4f03-869e-3a649887fba7");
                SponsorshipAddFormData data = SponsorshipAddForm.LoadData(this.API.AppFxWebServiceProvider, request);

                data.REVENUECONSTITUENTID          = constituentId;
                data.SPONSORSHIPCONSTITUENTID      = constituentId;
                data.SPONSORSHIPOPPORTUNITYIDCHILD = new Guid(dr["Id"].ToString());

                // CSM - Modified to not add CC info when this is a one time payment
                if ((this.radPayment.SelectedValue == "CC") && (this.radCcRecurrence.SelectedValue != "OneTimeGIft"))
                {
                    data.PAYMENTMETHODCODE_IDVALUE = Blackbaud.AppFx.Sponsorship.Catalog.WebApiClient.AddForms.Sponsorship.SponsorshipAddFormEnums.PAYMENTMETHODCODE.Credit_Card;
                    data.CARDHOLDERNAME            = this.txtCcName.Text;
                    data.CREDITCARDNUMBER          = this.txtCcNumber.Text;
                    data.CREDITTYPECODEID          = Utility.GetCrmCC(this.cmbCcType.SelectedValue);
                    data.FREQUENCYCODE_IDVALUE     = this.getFrequency();
                    data.EXPIRESON = new Blackbaud.AppFx.FuzzyDate(Convert.ToInt32(this.cmbCcExpYear.SelectedValue), Convert.ToInt32(this.cmbCcExpMonth.SelectedValue));
                    data.AUTOPAY   = true;
                }
                else
                {
                    data.AUTOPAY = false;
                }

                data.AMOUNT = Convert.ToDecimal(dr["Amount"]);

                data.SPONSORSHIPPROGRAMID      = new Guid("32FA809A-5EF1-4A17-862C-7DFE0AB49F19");
                data.STARTDATE                 = DateTime.Now;
                data.REVENUESCHEDULESTARTDATE  = DateTime.Now;
                data.GENDERCODE_IDVALUE        = this.getGender(dr["Gender"].ToString());
                data.ISHIVPOSITIVECODE_IDVALUE = Blackbaud.AppFx.Sponsorship.Catalog.WebApiClient.AddForms.Sponsorship.SponsorshipAddFormEnums.ISHIVPOSITIVECODE.No;
                data.HASCONDITIONCODE_IDVALUE  = Blackbaud.AppFx.Sponsorship.Catalog.WebApiClient.AddForms.Sponsorship.SponsorshipAddFormEnums.HASCONDITIONCODE.No;
                data.ISORPHANEDCODE_IDVALUE    = Blackbaud.AppFx.Sponsorship.Catalog.WebApiClient.AddForms.Sponsorship.SponsorshipAddFormEnums.ISORPHANEDCODE.No;
                data.GIFTRECIPIENT             = false;
                data.REFERENCE                 = ((Session[c_Referrer] == null ? String.Empty : Session[c_Referrer].ToString()) + "; " + cmbHearAbout.SelectedValue.ToString() + "-" + txtHearAboutResponse.Text);
                if (data.REFERENCE.Length > c_ReferenceMaxLength)
                {
                    data.REFERENCE = data.REFERENCE.Substring(0, c_ReferenceMaxLength);
                }
                data.Save(this.API.AppFxWebServiceProvider);
            }
        }
Ejemplo n.º 2
0
        private void createSponsorship(Guid constituentId)
        {
            foreach (DataRow dr in this.CartData.Rows)
            {
                DataFormLoadRequest request = SponsorshipAddForm.CreateLoadRequest(this.API.AppFxWebServiceProvider);
                request.FormID = new Guid("8a73db30-db6b-4f03-869e-3a649887fba7");
                SponsorshipAddFormData data = SponsorshipAddForm.LoadData(this.API.AppFxWebServiceProvider, request);

                data.REVENUECONSTITUENTID          = constituentId;
                data.SPONSORSHIPCONSTITUENTID      = constituentId;
                data.SPONSORSHIPOPPORTUNITYIDCHILD = new Guid(dr["Id"].ToString());

                if (this.radPayment.SelectedValue == "CC")
                {
                    data.PAYMENTMETHODCODE_IDVALUE = Blackbaud.AppFx.Sponsorship.Catalog.WebApiClient.AddForms.Sponsorship.SponsorshipAddFormEnums.PAYMENTMETHODCODE.Credit_Card;
                    data.CARDHOLDERNAME            = this.txtCcName.Text;
                    data.CREDITCARDNUMBER          = this.txtCcNumber.Text;
                    data.CREDITTYPECODEID          = Utility.GetCrmCC(this.cmbCcType.SelectedValue);
                    data.FREQUENCYCODE_IDVALUE     = this.getFrequency();
                    data.EXPIRESON = new Blackbaud.AppFx.FuzzyDate(Convert.ToInt32(this.cmbCcExpYear.SelectedValue), Convert.ToInt32(this.cmbCcExpMonth.SelectedValue));
                    data.AUTOPAY   = true;
                }
                else
                {
                    data.AUTOPAY = false;
                }

                data.AMOUNT = Convert.ToDecimal(dr["Amount"]);

                data.SPONSORSHIPPROGRAMID      = new Guid("32FA809A-5EF1-4A17-862C-7DFE0AB49F19");
                data.STARTDATE                 = DateTime.Now;
                data.REVENUESCHEDULESTARTDATE  = DateTime.Now;
                data.GENDERCODE_IDVALUE        = this.getGender(dr["Gender"].ToString());
                data.ISHIVPOSITIVECODE_IDVALUE = Blackbaud.AppFx.Sponsorship.Catalog.WebApiClient.AddForms.Sponsorship.SponsorshipAddFormEnums.ISHIVPOSITIVECODE.No;
                data.HASCONDITIONCODE_IDVALUE  = Blackbaud.AppFx.Sponsorship.Catalog.WebApiClient.AddForms.Sponsorship.SponsorshipAddFormEnums.HASCONDITIONCODE.No;
                data.ISORPHANEDCODE_IDVALUE    = Blackbaud.AppFx.Sponsorship.Catalog.WebApiClient.AddForms.Sponsorship.SponsorshipAddFormEnums.ISORPHANEDCODE.No;
                data.GIFTRECIPIENT             = false;
                data.BATCHNUMBER               = BATCHNUMBER;
                data.REFERENCE                 = cmbHearAbout.SelectedItem.Text + " | " + txtHearAboutResponse.Text + " | " + REFERRER;
                data.CHANNELCODEID             = GetChannelCodeID();

                Guid id = Guid.Empty;

                if (Guid.TryParse(cmbHearAbout.SelectedItem.Attributes["appealid"], out id))
                {
                    data.APPEALID = id;
                }

                data.Save(this.API.AppFxWebServiceProvider);

                Guid sponsorshipID = new Guid();

                if (Guid.TryParse(data.RecordID, out sponsorshipID))
                {
                    UpdateBatchNumber(sponsorshipID);

                    if (ddlHearAboutResponse.SelectedItem != null)
                    {
                        Guid solicitorID = Guid.Empty;
                        Guid.TryParse(ddlHearAboutResponse.SelectedItem.Attributes["data"], out solicitorID);

                        AddSolicitor(sponsorshipID, solicitorID);
                    }
                }
            }
        }