/// <summary> /// Handle Page Init event by obtaining the user profile /// and initalizing the controls. /// </summary> /// private void Page_Init() { Profile = Session[UserProfile.USER_PROFILE] as AppUserProfile; PreRender += new EventHandler(Page_PreRender); View_Init(finder); View_Init(letter_filter); letter_filter.View_Filter += new EventHandler(letter_filter_View_Filter); IViewHelper helper = Catalog.GetHelperFor(App.ENTRY_INITIAL); helper.Execute(); letter_filter.Open(helper.Outcome); View_Init(lister); finder.Filter_Changed += new EventHandler(finder_Filter_Changed); }
/// <summary> /// Create or retrieve an AppUserProfile /// based on the client's WindowsIdentity. /// </summary> /// <returns>A new or prexisting AppUserProfile</returns> /// protected AppUserProfile NewProfile() { WindowsIdentity id = WindowsIdentity.GetCurrent(); AppUserProfile profile = new AppUserProfile(id); Session[UserProfile.USER_PROFILE] = profile; IViewHelper helper = Catalog.GetHelperFor(App.ENTRY); helper.Criteria[App.USER_NAME] = profile.UserId; helper.Execute(); if (helper.IsNominal) { string editor = helper.Criteria[App.EDITOR] as string; // ISSUE: Need constant for "1" (true) bool isEditor = ((editor != null) && (editor.Equals("1"))); profile.IsEditor = isEditor; if (editor != null) { AppEntry entry = new AppEntry(); entry.AddAll(helper.Criteria); profile.Entry = entry; } } return profile; }