Color picker and scheming site
April 22nd, 2009Check out http://www.colr.org/ for help picking colors. I'm not very good at this so the site comes in very handy.
Awesome Quote
February 21st, 2009Read this great quote that is soo true and thought I would share.
Putt's Law
"Technology is dominated by two types of people: those who understand what they do not manage, and those who manage what they do not understand."
Activity Count Workflow Variables
February 20th, 2009In Dynamics CRM 4.0 workflows have the two internal variables of 'Activity Count' and 'Activity Count Including Workflow'. I found this really good post by Richard Knudson over at IMG about what the are actually for.
Setting up DNN for two Countries and Regions
January 29th, 2009By default DotNetNuke is setup for only one Country and Region field for user profiles. You can add a second and it will work out fine until you have a situation where the countries for one of the addresses is not the same as the other. The Region field slaves to the country field that has a value first. In order to get around this you need to create another data type and also change some of the logic in the DotNetNuke library. Since this is an open source project this isn't too painful to do.
First, if you don't already have it laying around, download the source for your version of DNN. You can find this on the DNN website.
After you get the Visual Studio project up get to the DotNetNuke.Library project and navigate to this file ...
\Controls\PropertyEditor\Edit Controls\DNN Edit Controls\DNNCountryEditControl.vb
Duplicate the file and name the duplicate DNNCountry2EditControl.vb
Next open up the file and rename the class to DNNCountry2EditControl as well as the ToolBox attribute.
Do the same thing for the Region control. The path for that is \Controls\PropertyEditor\Edit Controls\DNN Edit Controls\DNNRegionEditControl.vb
Duplicate the file and rename the Duplicate as DNNRegion2EditControl.vb and then open the file and update the Class name and ToolBox attribute.
The last major bit of code that we have to change is in \Controls\PropertyEditor\ProfileEditorControl.vb.
This file is what does the linking of the country to the region.
In the Protected Methods region there is the CreateEditor sub-routine. The condition we're looking for looks like this..
If TypeOf editor.Editor Is DNNRegionEditControl Then
Dim country As ListEntryInfo = Nothing
For Each checkEditor As FieldEditorControl In Fields
If TypeOf checkEditor.Editor Is DNNCountryEditControl Then
Dim countryEdit As DNNCountryEditControl = CType(checkEditor.Editor, DNNCountryEditControl)
Dim objListController As New ListController
Dim countries As ListEntryInfoCollection = objListController.GetListEntryInfoCollection("Country")
For Each checkCountry As ListEntryInfo In countries
If checkCountry.Text = CStr(countryEdit.Value) Then
country = checkCountry
Exit For
End If
Next
End If
Next
'Create a ListAttribute for the Region
Dim countryKey As String
If Not country Is Nothing Then
countryKey = "Country." & country.Value
Else
countryKey = "Country.Unknown"
End If
Dim attributes(-1) As Object
ReDim attributes(0)
attributes(0) = New ListAttribute("Region", countryKey, ListBoundField.Text, ListBoundField.Text)
editor.Editor.CustomAttributes = attributes
End If
Duplicate this section of code and paste it below the original. Go through and change the references of DNNCountryEditControl to DNNCountry2EditControl and DNNRegionEditControl to DNNRegion2EditControl. This just looks for our new types that we setup and links them together.
With those changes done compile the assembly and take the DotNetNuke.dll file and move it to your production site in the bin folder.
With the types available to us now we just have to tell DNN how to use them. Go to Host>List and click on the DataType list. You're going to add two types. One for Country2 and one for Region two. Just make them look like the existing Country and Region but with the different names.
Now were ready to use our two DataTypes. Add a country2 and region2 property to the profile using you're two new datatypes. If all goes well when you go to use them the region will be slaved to the country and you'll have two independent sets of county/region controls.
SSIS 2008 Script Component lets you write in C#
January 29th, 2009I'm pretty new SQL Server and it's family of products so when I first started playing around with SSIS in 2005 it was hard for me to grasp the whole Data Transformation thing as well as writing scripts for the Script Component, especially when I was forced write them in VB when I'm a C# guy.
Well now I have nothing more to complain about because in SSIS 2008 you can write your scripts for the script component in either VB or C#!!! And just so I could try it out I went and found some VB code someone wrote for SSIS and changed it over to C#.
Regex r;
Match m;
string pattern = string.Empty;
string returnValue;
pattern = "^[A-Z][A-Z]?[0-9][0-9]?[A-Z]? ?[0-9][A-Z][A-Z]$";
r = new Regex(pattern, RegexOptions.Compiled);
m = r.Match(input);
if (m.Success)
{
// YIPPEE
}
else
{
// NOT GOOD
}
That felt good!!