/// <summary>
        /// Gets the level.
        /// </summary>
        /// <param name="level">The level.</param>
        /// <param name="manager">The manager identifier.</param>
        /// <param name="dictionary">The dictionary.</param>
        /// <returns>level value.</returns>
        private static int RetrieveLevel(int level, DeveloperListItem manager, Dictionary<int, DeveloperListItem> dictionary)
        {
            if (manager.ManagerID.HasValue)
            {
                level++;

                manager = dictionary[manager.ManagerID.Value];

                return RetrieveLevel(level, manager, dictionary);
            }
            else
            {
                return level;
            }
        }
        /// <summary>
        /// Assigns the developer values.
        /// </summary>
        /// <param name="developer">The developer.</param>
        /// <param name="dictionary">The dictionary.</param>
        /// <returns>Developer List Item.</returns>
        private static DeveloperListItem AssignDeveloperValues(DeveloperListItem developer, Dictionary<int, DeveloperListItem> dictionary)
        {
            var firstName = string.Empty;
            var lastName = string.Empty;
            var words = developer.DeveloperName.Trim().Split(' ');
            if (words.Length > 0)
            {
                firstName = words[0];
            }

            if (words.Length > 1)
            {
                lastName = words[words.Length - 1].Substring(0, 1);
            }

            developer.DeveloperName = string.Format(CultureInfo.CurrentCulture, "{0} {1}", firstName, lastName);
            developer.DeveloperImage = developer.LoginID.RetrieveDeveloperImageName();

            var level = RetrieveLevel(0, developer, dictionary);
            developer.Level = level;
            developer.ColorScheme = level >= ColorsSchemes.Length ? ColorsSchemes[ColorsSchemes.Length - 1] : ColorsSchemes[level];
            return developer;
        }
 /// <summary>
 /// Adds the default developer.
 /// </summary>
 /// <returns>default Value</returns>
 private static DeveloperListItem AddDefaultDeveloper()
 {
     DeveloperListItem defaultValue = new DeveloperListItem();
     defaultValue.DeveloperID = MinusOne;
     defaultValue.DeveloperName = Select;
     return defaultValue;
 }
        /// <summary>
        /// Authenticates the windows user.
        /// </summary>
        private void AuthenticateWindowsUser()    
        {
            if (string.IsNullOrWhiteSpace(this.userNameTextBox.Text) || string.IsNullOrWhiteSpace(this.passwordPasswordBox.Password) || string.IsNullOrWhiteSpace(this.domainNameTextBox.Text))
            {
                return;
            }

            if (Authenticate(this.userNameTextBox.Text, this.passwordPasswordBox.Password, this.domainNameTextBox.Text))
            {
                this.developer = DependencyInjectionContainer.Instance.Container.Resolve<DeveloperService>().RetrieveByUserName(string.Format(CultureInfo.CurrentCulture, @"{0}\{1}", this.domainNameTextBox.Text, this.userNameTextBox.Text), this.developer.DeveloperID);
                this.Init(true);
            }
            else
            {
                CustomMessageBox.Show(Properties.Resources.InvalidCredentials, Properties.Resources.MarkYourContribution, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 /// <summary>
 /// Authenticates the user.
 /// </summary>
 private void AuthenticateUser()
 {
     var windowsIdentity = WindowsIdentity.GetCurrent();
     if (windowsIdentity != null)
     {
         this.developer = DependencyInjectionContainer.Instance.Container.Resolve<DeveloperService>().RetrieveByUserName(windowsIdentity.Name, null);
     }
 }
 /// <summary>
 /// Maps the developer to global search result type.
 /// </summary>
 /// <param name="developer">The developer details.</param>
 /// <returns>global search result type.</returns>
 private static GlobalSearchResult RetrieveDeveloperGlobalSearchResult(DeveloperListItem developer)
 {
     return new GlobalSearchResult
     {
         Name = developer.DeveloperName
     };
 }
 /// <summary>
 /// Maps the specified developer.
 /// </summary>
 /// <param name="developer">The developer.</param>
 /// <returns>Search Result</returns>
 private static SearchResultItem MapDeveloperToSearchresultItem(DeveloperListItem developer)
 {
     return new SearchResultItem
     {
         Id = developer.DeveloperID,
         Name = developer.DeveloperName,
         ResultType = SearchResultType.Developer,
         DeveloperImage = developer.LoginID.RetrieveDeveloperImageName(),
         Designation = developer.DesignationName,
         ReportingPerson = developer.ManagerName
     };
 }