Previous posts have illustrated how to make simple, custom forms that allow you to capture data from your users and then use that data for your own purposes.
Assuming you can identify the user who is filling in your form, however, you can also fetch data on that person from Raiser's Edge and use it in Netcommunity. There's a number of uses for this - the most obvious is that you could pre-fill certain bits of the form (in the same way that the built-in Blackbaud parts often do). This will make life easier for your website visitors, particularly if you've got a lot of forms.
Once you have a form set up (see previous posts for explanations on how to do this), then first of all you need to check if the current user viewing your form is logged in (and therefore identifiable):
if (!API.Users.CurrentUser.IsAnonymous)
Assuming they are not anonymous, you can then use the API to create an object containing any available data held on that user:
BBNCExtensions.API.Transactions.PaymentArgs p = this.API.Transactions.CreatePaymentArgs(true);
The 'true' argument loads the default set of data. To have a peek at what that contains, open up your references in Visual Studio (top right, usually) and double-click on BBNCExtensions and browse to BBNCExtensions.API.Transactions > PaymentArgs.
So now you have an object you can use in your form - for example, if you have a text box called 'box_name', you can pre-fill it with data assuming that the data exists in Raiser's Edge:
if (p.FirstName!=null) box_name.Text = p.FirstName;
Or, if you have a text box called 'box_address':
box_address.Text = (p.DonorAddress.StreetAddress + System.Environment.NewLine + p.DonorAddress.City);
The same goes for email address, telephone number, and all sorts of other things. Wahey!
Tuesday, 31 August 2010
Friday, 27 August 2010
Web security
If you're reading this then hopefully you will have at least a partial interest in keeping websites and web applications as secure as possible.
Google created something a while ago that might be useful, or at least interesting: Google Gruyere
It's a website they have developed to be deliberately insecure, and you are encouraged to try and attack and exploit it as much as you can, in order to learn a bit more about the common tricks that can be used against your website if you haven't secured it properly.
It's good fun. To some extent, a lot of the security holes in Gruyere are unlikely to apply to Blackbaud Netcommunity (or ASP.NET websites in general), as Microsoft have done a pretty decent job at covering your backside if you forget something (unlike PHP), but it's definitely worth looking at for educational purposes. Especially if you have third party code running on your server.
See how many holes you can find.
Speaking of PHP, does anyone use it on a day-to-day basis? I've been using it a bit recently, and I've really been missing the convenience of Visual Studio and the general nice-ness of C#. PHP feels very clumsy and awkward to me.
Google created something a while ago that might be useful, or at least interesting: Google Gruyere
It's a website they have developed to be deliberately insecure, and you are encouraged to try and attack and exploit it as much as you can, in order to learn a bit more about the common tricks that can be used against your website if you haven't secured it properly.
It's good fun. To some extent, a lot of the security holes in Gruyere are unlikely to apply to Blackbaud Netcommunity (or ASP.NET websites in general), as Microsoft have done a pretty decent job at covering your backside if you forget something (unlike PHP), but it's definitely worth looking at for educational purposes. Especially if you have third party code running on your server.
See how many holes you can find.
Speaking of PHP, does anyone use it on a day-to-day basis? I've been using it a bit recently, and I've really been missing the convenience of Visual Studio and the general nice-ness of C#. PHP feels very clumsy and awkward to me.
Subscribe to:
Posts (Atom)