protected override void CreateChildControls()
        {
            base.CreateChildControls();

            try
            {
                //Loads a user control
                DirectReports directReports = (DirectReports)Page.LoadControl("~/_controltemplates/TrainingManagement/DirectReports.ascx");
                directReports.Web       = SPContext.Current.Web;
                directReports.LoginName = SPContext.Current.Web.CurrentUser.LoginName;
                directReports.ShowLogin = this.showLogin;
                this.Controls.Add(directReports);
            }
            catch (HttpException ex)
            {
                this.Controls.Add(new LiteralControl("<br />An unexpected error occurred loading Web Part. " + ex.Message));
            }
        }
예제 #2
0
        private void InitializeDirectReports()
        {
            if (UserEntry != null)
            {
                PropertyValueCollection reports = UserEntry.Properties["directReports"];
                foreach (string report in reports)
                {
                    FullyQualifiedADName adName = GetADNameFromDescriptor(report);

                    UserInformation uiReport = new UserInformation();
                    if (!uiReport.InitializeWithFullName(adName.Name, adName.DomainName))
                    {
                        Planner.Instance.WriteToEventLog("Updating team members: fullname did not resolve: " + adName.Name);
                    }

                    DirectReports.Add(uiReport);
                }
            }
        }