private void AddSponsorship() { if (ChildID != Guid.Empty) { // grab off session once DataTable dt = this.cartData; //string id = Convert.ToString(Request.QueryString["id"]); // if the id is already in the cart, don't re-add it. DataRow[] check = dt.Select("id = '" + ChildID.ToString() + "'"); if (check.Length == 0) { DataFormLoadRequest opportunityRequest = OCM.BBISWebParts.WebsiteChildInfoViewForm.CreateRequest(this.API.AppFxWebServiceProvider); opportunityRequest.FormID = new Guid("9860f33f-efeb-478b-a312-f7e1c3bd4244"); opportunityRequest.RecordID = ChildID.ToString(); opportunityRequest.ContextRecordID = ChildID.ToString(); OCM.BBISWebParts.WebsiteChildInfoViewFormData opportunity = OCM.BBISWebParts.WebsiteChildInfoViewForm.LoadData(this.API.AppFxWebServiceProvider, opportunityRequest); DataRow dr = dt.NewRow(); dr["ID"] = ChildID; dr["Number"] = opportunity.CHILDLOOKUPID; dr["Name"] = opportunity.CHILDNAME; dr["Months"] = 1; dr["Amount"] = Classes.Utility.GetSponsorshipAmount(); dr["Gender"] = opportunity.GENDER; dr["CountryName"] = opportunity.COUNTRYNAME; dr["Birthdate"] = opportunity.BIRTHDATE; dt.Rows.Add(dr); // add data back to session this.cartData = dt; } } }
/// <summary> /// Create a constituent based on the information provided /// If no payment was entered, only the last name is used. The Sponsor ID entered is placed in the First Name. /// If a payment was entered, all payment contact information is used. /// </summary> /// <returns>ConstituentID of constituent created</returns> private Guid CreateConsitutent() { string addDataForm = "1f9671b3-6740-447c-ad15-ef2718c0e43a"; DataFormLoadRequest request = IndividualSpouseBusinessAddForm.CreateLoadRequest(this.API.AppFxWebServiceProvider); request.FormID = new Guid(addDataForm); IndividualSpouseBusinessAddFormData data = IndividualSpouseBusinessAddForm.LoadData(this.API.AppFxWebServiceProvider, request); if (this.cblPayment.Items[0].Selected) { data.FIRSTNAME = this.txtFirstName.Text.Trim(); data.MIDDLENAME = this.txtMiddle.Text; data.LASTNAME = this.txtLastName.Text.Trim(); data.ADDRESS_ADDRESSBLOCK = this.txtAddress.Text + " " + this.txtAddress2.Text; data.ADDRESS_CITY = this.txtCity.Text; data.ADDRESS_STATEID = GetStateID(cmbState.Text); data.ADDRESS_POSTCODE = this.txtZip.Text; data.PHONE_NUMBER = this.txtDayPhone.Text; data.EMAILADDRESS_EMAILADDRESS = this.txtEmail.Text; } else { data.LASTNAME = this.txtReversalResponseLastName.Text.Trim(); data.FIRSTNAME = this.txtSponsorId.Text.Trim(); } data.Save(this.API.AppFxWebServiceProvider); return(new Guid(data.RecordID)); }
private void submitPayment() { DataFormLoadRequest request = PaymentAddForm.CreateLoadRequest(this.API.AppFxWebServiceProvider); request.FormID = new Guid("3e5b7b99-fb01-49d4-9020-c953006b7d0f"); List <string> giftsToProcess = new List <string>(); if (ViewState["selectedSponsorships"] != null) { giftsToProcess = ViewState["selectedSponsorships"] as List <string>; } else { giftsToProcess.Add(ViewState["GiftId"].ToString()); } decimal enteredAmount = Convert.ToDecimal(this.txtAmount.Text); decimal amount = enteredAmount / giftsToProcess.Count; decimal runningTotal = 0; amount = Math.Round(amount, 2); for (int i = 0; i < giftsToProcess.Count; i++) { // if this is the last gift to process, check to see if we need to adjust for rounding if (i + 1 == giftsToProcess.Count) { if (runningTotal + amount != enteredAmount) { amount = enteredAmount - runningTotal; } } PaymentAddFormData data = PaymentAddForm.LoadData(this.API.AppFxWebServiceProvider, request); data.CONSTITUENTID = this.API.Users.CurrentUser.BackOfficeGuid; data.DATE = DateTime.Now; data.AMOUNT = amount; data.PAYMENTMETHODCODE_IDVALUE = AppFx.Fundraising.Catalog.WebApiClient.AddForms.Revenue.PaymentAddFormEnums.PAYMENTMETHODCODE.Credit_Card; data.APPLICATIONCODE_IDVALUE = AppFx.Fundraising.Catalog.WebApiClient.AddForms.Revenue.PaymentAddFormEnums.APPLICATIONCODE.Recurring_Gift; data.REVENUESTREAMS = new PaymentAddFormData.REVENUESTREAMS_DATAITEM[1]; data.REVENUESTREAMS[0] = new PaymentAddFormData.REVENUESTREAMS_DATAITEM(); data.REVENUESTREAMS[0].APPLICATIONCODE_IDVALUE = AppFx.Fundraising.Catalog.WebApiClient.AddForms.Revenue.PaymentAddFormEnums.REVENUESTREAMS_APPLICATIONCODE.Recurring_Gift; data.REVENUESTREAMS[0].APPLIED = amount; data.REVENUESTREAMS[0].APPLICATIONID = new Guid(giftsToProcess[i]); data.CREDITCARDNUMBER = this.txtCcNumber.Text; data.CARDHOLDERNAME = this.txtCcName.Text; data.EXPIRESON = new AppFx.FuzzyDate(Convert.ToInt32(this.cmbCcExpYear.SelectedValue), Convert.ToInt32(this.cmbCcExpMonth.SelectedValue)); data.CREDITTYPECODEID = Utility.GetCrmCC(this.cmbCcType.SelectedValue); data.RECEIPTAMOUNT = amount; data.SOURCECODE = "BBIS"; data.Save(this.API.AppFxWebServiceProvider); runningTotal += amount; } ViewState["selectedSponsorships"] = null; ViewState["GiftId"] = null; }
private Boolean LockChild(Guid childID) { Boolean childLocked = false; try { string addDataForm = "b46fe5b4-0fbf-4dfc-8f9b-e6b19f281720"; DataFormLoadRequest request = OCM.BBISWebParts.WebsiteChildLockAddDataForm.CreateLoadRequest(this.API.AppFxWebServiceProvider); request.FormID = new Guid(addDataForm); OCM.BBISWebParts.WebsiteChildLockAddDataFormData data = OCM.BBISWebParts.WebsiteChildLockAddDataForm.LoadData(this.API.AppFxWebServiceProvider, request); data.ContextRecordID = ChildID.ToString(); data.SESSIONID = Session.SessionID.ToString(); // if this is successful, then the child was locked. data.Save(this.API.AppFxWebServiceProvider); // ***** this.LoadChildInfo(id); ***** if (ChildID != Guid.Empty) { childLocked = true; } } catch (Exception ex) { // Determine if Child could not be locked if (ex.Message.ToString().Contains(LockError)) { if (ex.Message.ToString().Contains(LockUnsuccessful)) { string childLockedPageURL = Utility.GetBBISPageUrl(MyContent.ChildLockedPageID) + "{0}id=" + ChildID; childLockedPageURL = childLockedPageURL.IndexOf("?") > -1 ? String.Format(childLockedPageURL, "&") : String.Format(childLockedPageURL, "?"); Response.Redirect(childLockedPageURL, false); } else if (ex.Message.ToString().Contains(ChildNotEligible)) { string childIneligiblePageURL = Utility.GetBBISPageUrl(MyContent.ChildIneligiblePageID) + "{0}id=" + ChildID; childIneligiblePageURL = childIneligiblePageURL.IndexOf("?") > -1 ? String.Format(childIneligiblePageURL, "&") : String.Format(childIneligiblePageURL, "?"); Response.Redirect(childIneligiblePageURL, false); } else if (ex.Message.ToString().Contains(ChildNotReserved)) { string childUnavailablePageURL = Utility.GetBBISPageUrl(MyContent.ChildUnavailablePageID) + "{0}id=" + ChildID; childUnavailablePageURL = childUnavailablePageURL.IndexOf("?") > -1 ? String.Format(childUnavailablePageURL, "&") : String.Format(childUnavailablePageURL, "?"); Response.Redirect(childUnavailablePageURL, false); } } else { this.lblError.Text = ex.Message + "<br /><br />" + ex.StackTrace; this.lblError.Visible = true; } } return(childLocked); }
private void submitPayment() { DataFormLoadRequest request = PaymentAddForm.CreateLoadRequest(this.API.AppFxWebServiceProvider); request.FormID = new Guid("3e5b7b99-fb01-49d4-9020-c953006b7d0f"); PaymentAddFormData data = PaymentAddForm.LoadData(this.API.AppFxWebServiceProvider, request); data.CONSTITUENTID = this.API.Users.CurrentUser.BackOfficeGuid; data.DATE = DateTime.Now; data.AMOUNT = Convert.ToDecimal(this.txtAmount.Text); data.PAYMENTMETHODCODE_IDVALUE = Blackbaud.AppFx.Fundraising.Catalog.WebApiClient.AddForms.Revenue.PaymentAddFormEnums.PAYMENTMETHODCODE.Credit_Card; data.APPLICATIONCODE_IDVALUE = Blackbaud.AppFx.Fundraising.Catalog.WebApiClient.AddForms.Revenue.PaymentAddFormEnums.APPLICATIONCODE.Recurring_Gift; data.REVENUESTREAMS = new PaymentAddFormData.REVENUESTREAMS_DATAITEM[1]; data.REVENUESTREAMS[0] = new PaymentAddFormData.REVENUESTREAMS_DATAITEM(); data.REVENUESTREAMS[0].APPLICATIONCODE_IDVALUE = Blackbaud.AppFx.Fundraising.Catalog.WebApiClient.AddForms.Revenue.PaymentAddFormEnums.REVENUESTREAMS_APPLICATIONCODE.Recurring_Gift; data.REVENUESTREAMS[0].APPLIED = Convert.ToDecimal(this.txtAmount.Text); //data.REVENUESTREAMS[0].ID = new Guid("CB4BE127-694E-4645-828C-F099E87C7E91"); data.REVENUESTREAMS[0].APPLICATIONID = new Guid(Convert.ToString(ViewState["GiftId"])); data.CREDITCARDNUMBER = this.txtCcNumber.Text; data.CARDHOLDERNAME = this.txtCcName.Text; data.EXPIRESON = new Blackbaud.AppFx.FuzzyDate(Convert.ToInt32(this.cmbCcExpYear.SelectedValue), Convert.ToInt32(this.cmbCcExpMonth.SelectedValue)); data.CREDITTYPECODEID = Utility.GetCrmCC(this.cmbCcType.SelectedValue); data.RECEIPTAMOUNT = Convert.ToDecimal(this.txtAmount.Text); data.SOURCECODE = "BBIS"; data.Save(this.API.AppFxWebServiceProvider); }
/// <summary> /// This creates a donation to the designation provided in Config (e.g. SF) /// It doesn't actually apply it to a sponsorship recurring gift. /// </summary> /// <param name="constituentId">ID of Constituent to create payment for</param> /// <param name="authCode">Authorization Code from the credit card transaction</param> private void CreateSponsorshipPayment(Guid constituentId, string authCode) { DataFormLoadRequest request = PaymentAddForm.CreateLoadRequest(this.API.AppFxWebServiceProvider); request.FormID = new Guid("3e5b7b99-fb01-49d4-9020-c953006b7d0f"); PaymentAddFormData data = PaymentAddForm.LoadData(this.API.AppFxWebServiceProvider, request); data.CONSTITUENTID = constituentId; // used to be - this.API.Users.CurrentUser.BackOfficeGuid; data.DATE = DateTime.Now; data.AMOUNT = _paymentAmount; data.PAYMENTMETHODCODE_IDVALUE = Blackbaud.AppFx.Fundraising.Catalog.WebApiClient.AddForms.Revenue.PaymentAddFormEnums.PAYMENTMETHODCODE.Credit_Card; data.POSTSTATUSCODE_IDVALUE = Blackbaud.AppFx.Fundraising.Catalog.WebApiClient.AddForms.Revenue.PaymentAddFormEnums.POSTSTATUSCODE.Not_Posted; data.POSTDATE = DateTime.Now; data.APPLICATIONCODE_IDVALUE = Blackbaud.AppFx.Fundraising.Catalog.WebApiClient.AddForms.Revenue.PaymentAddFormEnums.APPLICATIONCODE.Donation; data.REVENUESTREAMS = new PaymentAddFormData.REVENUESTREAMS_DATAITEM[1]; data.REVENUESTREAMS[0] = new PaymentAddFormData.REVENUESTREAMS_DATAITEM(); data.REVENUESTREAMS[0].APPLICATIONCODE_IDVALUE = Blackbaud.AppFx.Fundraising.Catalog.WebApiClient.AddForms.Revenue.PaymentAddFormEnums.REVENUESTREAMS_APPLICATIONCODE.Donation; data.REVENUESTREAMS[0].APPLIED = _paymentAmount; data.REVENUESTREAMS[0].GIFTFIELDS = new PaymentAddFormData.REVENUESTREAMS_DATAITEM.GIFTFIELDS_DATAITEM[1]; data.REVENUESTREAMS[0].GIFTFIELDS[0] = new PaymentAddFormData.REVENUESTREAMS_DATAITEM.GIFTFIELDS_DATAITEM(); data.REVENUESTREAMS[0].GIFTFIELDS[0].DESIGNATIONID = Options.DesignationID; // ("7df20365-f328-4b7a-ad0b-83cc2f355e9d") SF data.REFERENCE = "D2 Rate Increase Reversal Form"; data.SOURCECODE = "BBIS"; data.CHANNELCODEID = new Guid("a087c9e2-32a1-42e3-96b7-28cc92e9b76b"); //website data.CREDITCARDNUMBER = this.txtCcNumber.Text; data.CARDHOLDERNAME = this.txtCcName.Text; data.EXPIRESON = new Blackbaud.AppFx.FuzzyDate(Convert.ToInt32(this.cmbCcExpYear.SelectedValue), Convert.ToInt32(this.cmbCcExpMonth.SelectedValue)); data.CREDITTYPECODEID = Utility.GetCrmCC(this.cmbCcType.SelectedValue); data.RECEIPTAMOUNT = _paymentAmount; data.AUTHORIZATIONCODE = authCode; data.Save(this.API.AppFxWebServiceProvider); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string addDataForm = "BFE2C12E-B6C9-4D1A-8102-FCD6F18B8B17"; DataFormLoadRequest request = OCM.BBISWebParts.WebsiteSessionPageActivityAddDataForm.CreateLoadRequest(this.API.AppFxWebServiceProvider); request.FormID = new Guid(addDataForm); OCM.BBISWebParts.WebsiteSessionPageActivityAddDataFormData data = OCM.BBISWebParts.WebsiteSessionPageActivityAddDataForm.LoadData(this.API.AppFxWebServiceProvider, request); data.ContextRecordID = "0"; // not used data.SESSIONID = Session.SessionID.ToString(); data.PAGEID = MyContent.PageID; data.PAGEURL = Utility.GetBBISPageUrl(MyContent.PageID); data.PAGENAME = MyContent.PageName; data.ACTUALURL = Request.RawUrl; data.Save(this.API.AppFxWebServiceProvider); } catch (Exception ex) { // do nothing - don't want any exceptions to be thrown } } }
private void SetRules() { try { DataFormLoadRequest dataFormLoadRequest = new DataFormLoadRequest(); dataFormLoadRequest.FormID = new Guid("c22b08b6-eb30-4026-95da-ef4f010ddeaf"); dataFormLoadRequest.SecurityContext = this.GetRequestSecurityContext(); DataFormLoadReply dataFormLoadReply = ServiceMethods.DataFormLoad(dataFormLoadRequest, this.GetRequestContext()); _customModel.NAMECODE.Value = (DuplicateResolutionUIModel.NAMECODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["NAMECODE"].Value); _customModel.SIMILARADDRESSCODE.Value = (DuplicateResolutionUIModel.SIMILARADDRESSCODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["SIMILARADDRESSCODE"].Value); _customModel.UNSIMILARADDRESSCODE.Value = (DuplicateResolutionUIModel.UNSIMILARADDRESSCODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["UNSIMILARADDRESSCODE"].Value); _customModel.NEWADDRESSPRIMARYCODE.Value = (DuplicateResolutionUIModel.NEWADDRESSPRIMARYCODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["NEWADDRESSPRIMARYCODE"].Value); _customModel.DIFFERENTPHONECODE.Value = (DuplicateResolutionUIModel.DIFFERENTPHONECODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["DIFFERENTPHONECODE"].Value); _customModel.NEWPHONEPRIMARYCODE.Value = (DuplicateResolutionUIModel.NEWPHONEPRIMARYCODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["NEWPHONEPRIMARYCODE"].Value); _customModel.DIFFERENTEMAILCODE.Value = (DuplicateResolutionUIModel.DIFFERENTEMAILCODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["DIFFERENTEMAILCODE"].Value); _customModel.NEWEMAILPRIMARYCODE.Value = (DuplicateResolutionUIModel.NEWEMAILPRIMARYCODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["NEWEMAILPRIMARYCODE"].Value); _customModel.BIRTHDATERULECODE.Value = (DuplicateResolutionUIModel.BIRTHDATERULECODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["BIRTHDATERULECODE"].Value); } catch (Exception expr_1DA) { ProjectData.SetProjectError(expr_1DA); Exception ex = expr_1DA; throw new InvalidUIModelException(ex.Message); } }
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); } }
private IEnumerable <string> GetPackageDependencies(AppFxWebService appFxService, ClientAppInfoHeader header, ItemInfo itemToLoad) { Log.LogMessage("Reading package spec '{0}' (ID: {1})", itemToLoad.ItemName, itemToLoad.ItemId); DataFormLoadRequest dfLoadReq = new DataFormLoadRequest(); dfLoadReq.ClientAppInfo = header; dfLoadReq.FormID = new Guid("8dcaab58-3b6a-405a-9430-5d07cb000d22"); // Catalog Item Xml View Form dfLoadReq.RecordID = string.Format("5|{0}", itemToLoad.ItemId); // Record ID is "[item type code]|[item ID]" DataFormLoadReply dfLoadReply = appFxService.DataFormLoad(dfLoadReq); if (dfLoadReply == null) { throw new Exception("Null reply from DataFormLoad."); } // Get item XML string itemXml = dfLoadReply.DataFormItem.Values.Where(x => x.ID == "ITEMXML").Select(x => x.Value.ToString()).FirstOrDefault(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(itemXml); // Load <Dependency> nodes, add items to load to list XmlNamespaceManager nsMgr = new XmlNamespaceManager(xmlDoc.NameTable); nsMgr.AddNamespace("c", "bb_appfx_commontypes"); XmlNodeList nodeList = xmlDoc.SelectNodes("//c:Dependency", nsMgr); if (nodeList.Count <= 0) { Log.LogWarning("Failed to find any Dependency nodes in package spec."); } List <string> itemsFromPackageSpec = new List <string>(); foreach (XmlNode dependencyNode in nodeList) { itemsFromPackageSpec.Add(dependencyNode.Attributes["CatalogItem"].Value); } return(itemsFromPackageSpec); }
//Gets Default CountryID private Guid GetDefaultCountryID() { DataFormLoadRequest request = new DataFormLoadRequest { FormID = DEFAULTCOUNTRY_VIEWFORMID, IncludeMetaData = false }; DataFormLoadReply reply = default(DataFormLoadReply); Guid countryID = Guid.Empty; reply = ServiceMethods.DataFormLoad(request, _model.GetRequestContext()); if (reply.DataFormItem.TryGetValue("COUNTRYID", ref countryID)) { return(countryID); } return(Guid.Empty); }
public void addGift(Guid constituentId) { DataFormLoadRequest request = RecurringGiftAddForm.CreateLoadRequest(this.API.AppFxWebServiceProvider); request.FormID = new Guid("47a3c222-5e99-44a2-a5ce-5989d18f5a13"); RecurringGiftAddFormData data = RecurringGiftAddForm.LoadData(this.API.AppFxWebServiceProvider, request); data.AMOUNT = this.total; data.CONSTITUENTID = constituentId; data.CARDHOLDERNAME = this.txtCcName.Text; data.CREDITCARDNUMBER = this.txtCcNumber.Text; data.CREDITTYPECODEID = Utility.GetCrmCC(this.cmbCcType.SelectedValue); data.EXPIRESON = new Blackbaud.AppFx.FuzzyDate(Convert.ToInt32(this.cmbCcExpYear.SelectedValue), Convert.ToInt32(this.cmbCcExpMonth.SelectedValue)); data.DATE = DateTime.Now; data.STARTDATE = DateTime.Now; data.SPLITS = new RecurringGiftAddFormData.SPLITS_DATAITEM[1]; data.SPLITS[0] = new RecurringGiftAddFormData.SPLITS_DATAITEM(); data.SPLITS[0].AMOUNT = this.total; data.SPLITS[0].DESIGNATIONID = new Guid("1B2EB1A9-2FC3-4AD1-A28C-2920799C3FDF"); data.Save(this.API.AppFxWebServiceProvider); }
private void CreateReversalNote(Guid constituentID, bool reversalChecked, bool paymentChecked) { DataFormLoadRequest request = ConstituentNoteAddForm.CreateLoadRequest(this.API.AppFxWebServiceProvider); request.ContextRecordID = constituentID.ToString(); ConstituentNoteAddFormData dataNote = ConstituentNoteAddForm.LoadData(this.API.AppFxWebServiceProvider, request); dataNote.DATEENTERED = DateTime.Now; dataNote.NOTETYPECODEID = new Guid(Options.ReversalNoteTypeID.ToString()); //Rate Increase 2014 - Reversal string textNote; if (reversalChecked) { dataNote.TITLE = Options.ConstituentNoteTitle; textNote = Options.ConstituentNoteText; // dataNote.TITLE = "Reversal requested through website"; // dataNote.TEXTNOTE = "Rate Increase Reversal requested through website on " + DateTime.Now.ToString() + " ET. This was in response to the special Rate Increase D2 email."; } else { dataNote.TITLE = Options.ConstituentNoteTitleNoReversal; textNote = Options.ConstituentNoteTextNoReversal; // dataNote.TITLE = "Reversal form filled out but reversal unchecked"; // dataNote.TEXTNOTE = "Rate Increase Reversal Form completed on website on " + DateTime.Now.ToString() + " ET, but the Reversal checkbox was not checked. This was in response to the special Rate Increase D2 email."; } dataNote.TEXTNOTE = textNote.Replace("<Date>", DateTime.Now.ToString() + " ET"); if (paymentChecked) { dataNote.TEXTNOTE += Options.ConstituentNoteTextPayment; // dataNote.TEXTNOTE += " Payment was made online as well."; } dataNote.Save(this.API.AppFxWebServiceProvider); }
private Guid createConsitutent(Guid stateID) { string addDataForm = "1f9671b3-6740-447c-ad15-ef2718c0e43a"; DataFormLoadRequest request = Const.AddForms.Constituent.IndividualSpouseBusinessAddForm.CreateLoadRequest(this.API.AppFxWebServiceProvider); request.FormID = new Guid(addDataForm); Const.AddForms.Constituent.IndividualSpouseBusinessAddFormData data = Const.AddForms.Constituent.IndividualSpouseBusinessAddForm.LoadData(this.API.AppFxWebServiceProvider, request); data.FIRSTNAME = this.txtFirstName.Text; data.MIDDLENAME = this.txtMiddle.Text; data.LASTNAME = this.txtLastName.Text; data.ADDRESS_ADDRESSBLOCK = this.txtAddress.Text + " " + this.txtAddress2.Text; data.ADDRESS_CITY = this.txtCity.Text; data.ADDRESS_POSTCODE = this.txtZip.Text; data.ADDRESS_STATEID = stateID; data.PHONE_NUMBER = this.txtDayPhone.Text; data.EMAILADDRESS_EMAILADDRESS = this.txtEmail.Text; data.Save(this.API.AppFxWebServiceProvider); return(new Guid(data.RecordID)); }
internal void Init() { List <string> keyNameCaptionTypes = new List <string>(3); if (_includeindividuals.Value) { _numConstituentTypesAllowed += 1; } if (_includeorganizations.Value) { _numConstituentTypesAllowed += 1; } if (_includegroups.Value) { _numConstituentTypesAllowed += 1; } if (!_includeorganizations.Enabled) { _includeOrgIsEnabled = false; } if (_includeindividuals.Value) { keyNameCaptionTypes.Add("Last"); } if (_includeorganizations.Value) { if (_numConstituentTypesAllowed == 1) { keyNameCaptionTypes.Add("Organization"); } else { keyNameCaptionTypes.Add("Org"); } } if (_includegroups.Value) { if (_excludecustomgroups.Value) { keyNameCaptionTypes.Add("Household"); } else if (_numConstituentTypesAllowed == 1) { keyNameCaptionTypes.Add("Group/Household"); } else { keyNameCaptionTypes.Add("Group"); } } EnableConstituentTypeOptions(); _keyname.Caption = string.Format("{0} name", Strings.Join(keyNameCaptionTypes.ToArray(), "/")); if (_excludecustomgroups.Value) { _includegroups.Caption = "Households"; } else if (_excludehouseholds.Value) { _includegroups.Caption = "Groups"; } DataFormLoadRequest req = new DataFormLoadRequest { FormID = new Guid("12c490b6-5f6b-4eab-85a7-3c38ee492b44") }; dynamic reply = ServiceMethods.DataFormLoad(req, _model.GetRequestContext()); //BVS-SOTEY commented out //bool AVAILABLEZIPSEARCH = false; //if (reply.DataFormItem.TryGetValue("AVAILABLEZIPSEARCH", AVAILABLEZIPSEARCH)) //{ // //Searching Postcodes is enabled based on whether there are available Zip codes to search. // //Otherwise, it is just a text box to enter. // _postcode.SearchEnabled = AVAILABLEZIPSEARCH; //} if (_ssn.Visible) { if (!_model.GetRequestContext().UserIsGrantedPrivilege(new Guid("d908668e-210f-47a8-bd45-ef9517e4894f"))) { _ssn.Visible = false; } } //Setting Labels based on Default Country CountryGetFormatsReply _countryFormats = GetCountryFormats(_model.GetRequestContext()); CountryGetFormatsFormatRow labelRow = GetCountryFormatRow(_countryFormats, GetDefaultCountryID()); if (labelRow != null) { _city.Caption = labelRow.City; _stateid.Caption = labelRow.State; _postcode.Caption = labelRow.PostCode; //Updating Grid Columns Header foreach (SearchListOutputFieldType outputField in _outputDefinition.OutputFields) { switch (outputField.FieldID) { case "City": outputField.Caption = labelRow.City; break; case "State": outputField.Caption = labelRow.State; break; case "Postcode": outputField.Caption = labelRow.PostCode; break; } } } }
private void bindCommitments() { DataTable dt = new DataTable(); dt.Columns.Add("Id"); dt.Columns.Add("Commitment"); dt.Columns.Add("Amount"); dt.Columns.Add("AutoPay"); dt.Columns.Add("Frequency"); DataListLoadRequest request = SponsorshipDataList.CreateRequest(this.API.AppFxWebServiceProvider); request.DataListID = new Guid("b87f9b24-91e9-40c2-b54a-f6fbcc09f6f0"); if (Request.QueryString["Id"] != null) // Why is this here?? { request.ContextRecordID = Convert.ToString(Request.QueryString["Id"]); } else { request.ContextRecordID = this.API.Users.CurrentUser.BackOfficeGuid.ToString(); } SponsorshipDataListRow[] rows = SponsorshipDataList.GetRows(this.API.AppFxWebServiceProvider, request); foreach (SponsorshipDataListRow row in rows) { DataFormLoadRequest sponsorshipRequest = SponsorshipPaymentViewForm.CreateRequest(this.API.AppFxWebServiceProvider); sponsorshipRequest.FormID = new Guid("aeed02c3-ddba-41bc-8e7c-341c77068875"); sponsorshipRequest.ContextRecordID = row.SPONSORSHIPID.ToString(); sponsorshipRequest.RecordID = row.SPONSORSHIPID.ToString(); SponsorshipPaymentViewFormData data = SponsorshipPaymentViewForm.LoadData(this.API.AppFxWebServiceProvider, sponsorshipRequest); DataFormLoadRequest paymentRequest = RevenuePaymentDetailsByTransactionViewForm.CreateRequest(this.API.AppFxWebServiceProvider); paymentRequest.FormID = new Guid("bafca6f5-4cdb-4173-aece-113713d38bfb"); paymentRequest.ContextRecordID = row.REVENUEID.ToString(); paymentRequest.RecordID = row.REVENUEID.ToString(); RevenuePaymentDetailsByTransactionViewFormData paymentData = RevenuePaymentDetailsByTransactionViewForm.LoadData(this.API.AppFxWebServiceProvider, paymentRequest); DataRow dr = dt.NewRow(); dr["Commitment"] = row.NAME + " (" + row.COMMITMENTID + ")"; if (data.BASEAMOUNT.HasValue) { dr["Amount"] = data.BASEAMOUNT.Value.ToString("c"); } dr["Frequency"] = data.FREQUENCY; dr["AutoPay"] = paymentData.AUTOPAY.Value ? "Yes" : "No"; dr["Id"] = row.REVENUEID.ToString(); dt.Rows.Add(dr); } DataListLoadRequest giftRequest = ConstituentExpandedRevenueHistoryList.CreateRequest(this.API.AppFxWebServiceProvider); giftRequest.DataListID = new Guid("4c2acb2c-a819-4092-a599-e43102824b1e"); giftRequest.ContextRecordID = this.API.Users.CurrentUser.BackOfficeGuid.ToString(); ConstituentExpandedRevenueHistoryListFilterData filter = new ConstituentExpandedRevenueHistoryListFilterData(); filter.TRANSACTIONTYPEOPTIONCODE_IDVALUE = Blackbaud.AppFx.Fundraising.Catalog.WebApiClient.DataLists.Constituent.ConstituentExpandedRevenueHistoryListEnums.TRANSACTIONTYPEOPTIONCODE.Recurring_Gifts; ConstituentExpandedRevenueHistoryListRow[] giftRows = ConstituentExpandedRevenueHistoryList.GetRows(this.API.AppFxWebServiceProvider, giftRequest); foreach (ConstituentExpandedRevenueHistoryListRow row in giftRows) { if (row.TRANSACTIONTYPECODE != "Recurring gift") { continue; } if (row.REVENUETYPE == "Sponsorship") { continue; } DataRow dr = dt.NewRow(); DataFormLoadRequest sponsorshipRequest = RevenueTransactionProfileViewForm.CreateRequest(this.API.AppFxWebServiceProvider); sponsorshipRequest.FormID = new Guid("74f1a311-2ed9-4c0b-b666-9bf318748d9b"); sponsorshipRequest.ContextRecordID = row.REVENUEID.ToString(); sponsorshipRequest.RecordID = row.REVENUEID.ToString(); RevenueTransactionProfileViewFormData data = RevenueTransactionProfileViewForm.LoadData(this.API.AppFxWebServiceProvider, sponsorshipRequest); DataFormLoadRequest paymentRequest = RevenuePaymentDetailsByTransactionViewForm.CreateRequest(this.API.AppFxWebServiceProvider); paymentRequest.FormID = new Guid("bafca6f5-4cdb-4173-aece-113713d38bfb"); paymentRequest.ContextRecordID = row.REVENUEID.ToString(); paymentRequest.RecordID = row.REVENUEID.ToString(); RevenuePaymentDetailsByTransactionViewFormData paymentData = RevenuePaymentDetailsByTransactionViewForm.LoadData(this.API.AppFxWebServiceProvider, paymentRequest); dr["Commitment"] = row.DETAIL; dr["Amount"] = row.AMOUNT.ToString("c"); dr["Frequency"] = data.FREQUENCY; dr["AutoPay"] = paymentData.AUTOPAY.Value ? "Yes" : "No"; dr["Id"] = row.REVENUEID.ToString(); dt.Rows.Add(dr); } this.gvCommitments.DataSource = dt; this.gvCommitments.DataBind(); }
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); } } } }
//Function to switch the lookup id and constituent name as per search public static void SwitchConstituentMIMED(UMHSDataERBBatchEntryHandler handler, Blackbaud.AppFx.UIModeling.Core.UIModel batchModel, Guid MedConstituentId, string donorinfo) { DataFormLoadRequest reqlkpid = new DataFormLoadRequest { FormID = MIMEDDataViewForm, RecordID = MedConstituentId.ToString() }; DataFormLoadReply replylkpid = null; try { replylkpid = ServiceMethods.DataFormLoad(reqlkpid, batchModel.RootUIModel().GetRequestContext()); } catch (Exception ex) { throw ex; //nom nom nom } //' Save the current constituent's name and guid and lookupid before we start changing anything Guid currentConstituentId = Guid.Parse(GetValueFromFieldID(batchModel, "CONSTITUENTID", null).ToString()); string currentConstituentName = GetValueTranslationFromFieldID(batchModel, "CONSTITUENTID", null); string currentLookupId = GetValueTranslationFromFieldID(batchModel, "CONSTITUENTLOOKUPID", null); if (donorinfo.Length > 0) { if (donorinfo.Contains("N:")) { string[] s = donorinfo.Split(char.Parse("|")); foreach (string i in s) { if ((i.Contains("N:"))) { donorinfo = i.Substring(4); } } } } //AndAlso replyname IsNot Nothing AndAlso replyname.PageData IsNot Nothing Then if (replylkpid != null && replylkpid.DataFormItem != null) { DataFormFieldValue dfv = null; //Dim dfn As DataFormFieldValue = Nothing string name = string.Empty; string lookupid = string.Empty; //If replyname.PageData.TryGetValue("NAME", dfn) AndAlso dfn IsNot Nothing AndAlso dfn.Value IsNot Nothing Then if ((donorinfo != null) || !string.IsNullOrEmpty(donorinfo)) { name = donorinfo; } //End If if (replylkpid.DataFormItem.TryGetValue("LOOKUPID", ref dfv) && dfv != null && dfv.Value != null) { lookupid = dfv.Value.ToString(); } //SET Constituent Name //' UIModel allows us to easily move values from the related constituent form to the batch row TrySetValueForFieldID(batchModel, "CONSTITUENTID", MedConstituentId, name); TrySetValueForFieldID(batchModel, "CONSTITUENTLOOKUPID", MedConstituentId, lookupid); } handler.UpdateContextWindow(); }