TimePicker Updates

June 25th, 2017 Michael Bell 22 comments

It’s been awhile, but I’ve finally got some updates released. You will find:

  • the 24 hour mode works as expected now
  • CSS has been altered to include positioning fixes for the colons in IE8 and FF 3.6
  • issues have been addressed for problems that manifest themselves when there are multiple pickers on a page and you try to change focus and change time

Thanks!

A Special Education Vent (Autism)

June 25th, 2017 Michael Bell 3 comments

Every parent wants the best education for their child. I’ve become increasingly aware that “special education” in our public schools more closely translates to “sub-par education”. Not by fault of the teachers or staff, but the whole system. How can a child that requires extra attention, be expected to perform when they are mixed with a group of kids ranging in ages from 5 to 10 in one large classroom? With Autism, the less distractions, the better. How well can I expect my daughter to do in a dark, gloomy classroom away from the rest of the “normal” classes and students? Why is the education system in this country always based on a minimalist approach? It’s horribly unfair to our children. It’s daunting when you start looking into private schooling costs or uprooting and relocating your family (3 kids) for a school that specializes in autism when you may or may not be able to get some kind of funding to help you pay the $50k+ a year tuition. The education system in our country makes me sick.

Categories: Family, Shelby / Autism Tags:

Custom UserProfile Property Class for SharePoint

June 25th, 2017 Michael Bell 3 comments

I had a recent project where I needed to bind to the properties in the sharepoint userprofile collection. I found the easiest method was to create an object that contains properties that use the PropertyConstant enumerator to return values from the UserProfile object. It may not be the cleanest, but it let me bind a list of these to a grid, which was what I needed to do.

[Serializable]
 public class UserProfilePropertyObject
 {
 private UserProfile _userProfile = null;

 public UserProfilePropertyObject(UserProfile userProfile)
 {
 _userProfile = userProfile;
 }

 public string FullName
 {
 get { return LastName + ", " + FirstName; }
 }
 public string AccountName
 {
 get
 {
 return (_userProfile[PropertyConstants.AccountName].Value ?? "N/A").ToString();
 }
 }
 public string FirstName
 {
 get
 {
 return (_userProfile[PropertyConstants.FirstName].Value ?? "N/A").ToString();
 }
 }
 public string LastName
 {
 get
 {
 return (_userProfile[PropertyConstants.LastName].Value ?? "N/A").ToString();
 }
 }
 public string Username
 {
 get
 {
 return (_userProfile[PropertyConstants.UserName].Value ?? "N/A").ToString();
 }
 }
 public string WorkPhone
 {
 get
 {
 return (_userProfile[PropertyConstants.WorkPhone].Value ?? "N/A").ToString();
 }
 }
 public string Office
 {
 get
 {
 return (_userProfile[PropertyConstants.Office].Value ?? "N/A").ToString();
 }
 }
 public string Department
 {
 get
 {
 return (_userProfile[PropertyConstants.Department].Value ?? "N/A").ToString();
 }
 }
 public string Title
 {
 get
 {
 return (_userProfile[PropertyConstants.Title].Value ?? "N/A").ToString();
 }
 }
 public string Manager
 {
 get
 {
 return (_userProfile[PropertyConstants.Manager].Value ?? "N/A").ToString();
 }
 }
 public string AboutMe
 {
 get
 {
 return (_userProfile[PropertyConstants.AboutMe].Value ?? "N/A").ToString();
 }
 }
 public string PersonalSite
 {
 get
 {
 return (_userProfile[PropertyConstants.PersonalSpace].Value ?? "N/A").ToString();
 }
 }
 public string Picture
 {
 get
 {
 return (_userProfile[PropertyConstants.PictureUrl].Value ?? "N/A").ToString();
 }
 }
 public string Website
 {
 get
 {
 return (_userProfile[PropertyConstants.WebSite].Value ?? "N/A").ToString();
 }
 }
 public string PublicSiteRedirect
 {
 get
 {
 return (_userProfile[PropertyConstants.PublicSiteRedirect].Value ?? "N/A").ToString();
 }
 }
 public string DottedLineManager
 {
 get
 {
 return (_userProfile[PropertyConstants.Dottedline].Value ?? "N/A").ToString();
 }
 }
 public string Responsibilities
 {
 get
 {
 return (_userProfile[PropertyConstants.Responsibility].Value ?? "N/A").ToString();
 }
 }
 public string Skills
 {
 get
 {
 return (_userProfile[PropertyConstants.Skills].Value ?? "N/A").ToString();
 }
 }
 public string PastProjects
 {
 get
 {
 return (_userProfile[PropertyConstants.PastProjects].Value ?? "N/A").ToString();
 }
 }
 public string Interests
 {
 get
 {
 return (_userProfile[PropertyConstants.Interests].Value ?? "N/A").ToString();
 }
 }
 public string Schools
 {
 get
 {
 return (_userProfile[PropertyConstants.School].Value ?? "N/A").ToString();
 }
 }
 public string SIPAddress
 {
 get
 {
 return (_userProfile[PropertyConstants.SipAddress].Value ?? "N/A").ToString();
 }
 }
 public string Birthday
 {
 get
 {
 return (_userProfile[PropertyConstants.Birthday].Value ?? "N/A").ToString();
 }
 }
 public string MySiteUpgrade
 {
 get
 {
 return (_userProfile[PropertyConstants.MySiteUpgrade].Value ?? "N/A").ToString();
 }
 }
 public string DontSuggestList
 {
 get
 {
 return (_userProfile[PropertyConstants.DontSuggestList].Value ?? "N/A").ToString();
 }
 }
 public string HireDate
 {
 get
 {
 return (_userProfile[PropertyConstants.HireDate].Value ?? "N/A").ToString();
 }
 }
 public string LastColleagueAdd
 {
 get
 {
 return (_userProfile[PropertyConstants.LastColleagueAdded].Value ?? "N/A").ToString();
 }
 }
 public string OutlookWebAccessURL
 {
 get
 {
 return (_userProfile[PropertyConstants.OutlookWebAccessUrl].Value ?? "N/A").ToString();
 }
 }
 public string Assistant
 {
 get
 {
 return (_userProfile[PropertyConstants.Assistant].Value ?? "N/A").ToString();
 }
 }
 public string WorkEmail
 {
 get
 {
 return (_userProfile[PropertyConstants.WorkEmail].Value ?? "N/A").ToString();
 }
 }
 public string MobilePhone
 {
 get
 {
 return (_userProfile[PropertyConstants.CellPhone].Value ?? "N/A").ToString();
 }
 }
 public string Fax
 {
 get
 {
 return (_userProfile[PropertyConstants.Fax].Value ?? "N/A").ToString();
 }
 }
 public string HomePhone
 {
 get
 {
 return (_userProfile[PropertyConstants.HomePhone].Value ?? "N/A").ToString();
 }
 }
 public Guid ID
 {
 get
 {
 return _userProfile.ID;
 }
 }

 }
Categories: MOSS, SharePoint 2007, c# Tags:

Validation against Controls outside of the current NamingContainer

June 25th, 2017 Michael Bell 1 comment

I had a situation where I needed to do this recently. I googled of course, and came up with an overloaded FindControl method. I implemented this in my code, and all seemed well. UNTIL… came the time to get the data posted from my control. I had controls nested in a UserControl, and that usercontrol nested within a FormView. When the postback occurred, I was able to retrieve all values from controls directly in the formview but none from within the controls inside my usercontrol. A buddy of mine helped me out on this, and believe me.. it was no fun tracking down. the values “not being posted” was actually a flaw in the FindControl method override. Please use this piece of code in the naming container that your validators reside, if they in fact need to validate against controls outside:

protected override Control FindControl(string id, int pathOffset)
{
Control c = base.FindControl(id, pathOffset);
if (c != null)
return c;
return FindControl(Page, id);
}
public Control FindControl(Control parent, string id)
{
Control recurse;
if (parent.ID == id)
{
return parent;
}
foreach (Control child in parent.Controls)
{
recurse = FindControl(child, id);
if (recurse != null)
{
return recurse;
}
}
return null;
}
Categories: ASP.NET, Uncategorized, Whatever, c# Tags: