//called by configuration screen public static SvcProject.ProjectDataSet ReadProjectsList() { SvcProject.ProjectDataSet projectList = new SvcProject.ProjectDataSet(); try { using (OperationContextScope scope = new OperationContextScope(projectClient.InnerChannel)) { WcfHelpers.UseCorrectHeaders(isImpersonated); Utility.WriteLog(string.Format("Calling ReadStatus"), System.Diagnostics.EventLogEntryType.Information); SvcStatusing.StatusingDataSet dataSet = pwaClient.ReadStatus(Guid.Empty, DateTime.MinValue, DateTime.MaxValue); Utility.WriteLog(string.Format("ReadStatus Successful"), System.Diagnostics.EventLogEntryType.Information); // Get projects of type normal, templates, proposals, master, and inserted. string projectName = string.Empty; Utility.WriteLog(string.Format("Calling ReadStatus on Project Store"), System.Diagnostics.EventLogEntryType.Information); projectList.Merge(projectClient.ReadProjectStatus(Guid.Empty, SvcProject.DataStoreEnum.PublishedStore, projectName, (int)PSLib.Project.ProjectType.Project)); Utility.WriteLog(string.Format("ReadStatus on Project Store Successful"), System.Diagnostics.EventLogEntryType.Information); Utility.WriteLog(string.Format("Calling ReadStatus on Inserted Store"), System.Diagnostics.EventLogEntryType.Information); projectList.Merge(projectClient.ReadProjectStatus(Guid.Empty, SvcProject.DataStoreEnum.PublishedStore, projectName, (int)PSLib.Project.ProjectType.InsertedProject)); Utility.WriteLog(string.Format("ReadStatus on Inserted Store Successful"), System.Diagnostics.EventLogEntryType.Information); Utility.WriteLog(string.Format("Calling ReadStatus on Published Store"), System.Diagnostics.EventLogEntryType.Information); projectList.Merge(projectClient.ReadProjectStatus(Guid.Empty, SvcProject.DataStoreEnum.PublishedStore, projectName, (int)PSLib.Project.ProjectType.MasterProject)); Utility.WriteLog(string.Format("ReadStatus on Inserted Published Store Successful"), System.Diagnostics.EventLogEntryType.Information); //SvcProject.ProjectDataSet pds = projectClient.ReadProjectList(); // this fails if no permission... Conversely...ReadProjectStatus returns 0 if no permission. } } catch (Exception ex) { Utility.WriteLog(string.Format("An error occured in ReadProjectsList and the error ={0}", ex.Message), System.Diagnostics.EventLogEntryType.Information); } finally { } return projectList; }
public static string[] GetProjectNames(DataSet ds) { var projectDataSet = new SvcProject.ProjectDataSet(); string[] projectNames = new string[ds.Tables.Count]; int count = 0; foreach(DataTable table in ds.Tables) { projectNames[count] = (table.Rows[0][_mapping.ProjectMap[projectDataSet.Project.PROJ_NAMEColumn.ToString()]].ToString()); count++; } return projectNames; }