Exemple #1
0
        /// <summary>Refreshes project name if necessary.</summary>
        private void refreshProject()
        {
            //Only run if it's not set.
            if ((this.ProjectName == "Project" || string.IsNullOrEmpty(this.ProjectName)) || this.UserID == -1)
            {
                try
                {
                    ImportExportClient client = StaticFuncs.CreateClient(this.ServerURL.ToString());

                    //Connect and get the project information.
                    if (client.Connection_Authenticate2(this.UserName, this.UserPass, StaticFuncs.getCultureResource.GetString("app_ReportName")))
                    {
                        //Connected, get project and user information.
                        this.ProjectName = client.Project_RetrieveById(this.ProjectID).Name;
                        this.UserID      = client.User_RetrieveByUserName(this.UserName).UserId.Value;
                    }
                }
                catch
                { }
            }
        }