Exemplo n.º 1
0
        /// <summary>
        /// This method returns the email address of the current user.
        /// </summary>
        /// <returns></returns>
        private string GetLoginUserEmail()
        {
            EDS.Intranet.Common.ContactLookup contact;
            bool   contactFound;
            string globalNetID;
            string userEmail;

            try
            {
                //Retrieve names from global net ID
                globalNetID  = this.LoginUserID;
                globalNetID  = globalNetID.Trim();
                contact      = new EDS.Intranet.Common.ContactLookup();
                contactFound = contact.LookupContact(globalNetID);

                if (contactFound)
                {
                    userEmail = contact.Email;
                }
                else
                {
                    userEmail = String.Empty;
                }

                return(userEmail);
            }

            catch (System.Exception)
            {
                return(String.Empty);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method returns the name of the current user.
        /// </summary>
        /// <returns></returns>
        private string GetLoginUserName()
        {
            EDS.Intranet.Common.ContactLookup contact;
            bool   contactFound;
            string globalNetID;
            string userName;

            try
            {
                //Retrieve names from global net ID
                globalNetID  = this.LoginUserID;
                globalNetID  = globalNetID.Trim();
                contact      = new EDS.Intranet.Common.ContactLookup();
                contactFound = contact.LookupContact(globalNetID);

                if (contactFound)
                {
                    userName = contact.FirstName + " " + contact.LastName;
                }
                else
                {
                    userName = "******";
                }

                return(userName);
            }

            catch (System.Exception)
            {
                return("");
            }
        }