private static void MapLists(SPWeb spWeb, HashSet <Guid> listsToBeMapped) { try { var epmData = new ReportHelper.EPMData(true, spWeb.Site.ID, spWeb.ID); epmData.MapLists(listsToBeMapped, spWeb.ID); } catch (Exception ex) { LoggingService.WriteTrace( Area.EPMLiveCore, Categories.EPMLiveCore.Event, TraceSeverity.Verbose, ex.ToString() ); } }
private static void SetListsIcons(SPWeb spWeb, Dictionary <string, string> listIconsToBeSet) { if (listIconsToBeSet.Count > 0) { try { var epmData = new ReportHelper.EPMData(true, spWeb.Site.ID, spWeb.ID); epmData.SetListIcon(listIconsToBeSet); } catch (Exception ex) { LoggingService.WriteTrace( Area.EPMLiveCore, Categories.EPMLiveCore.Event, TraceSeverity.Verbose, ex.ToString() ); } } }
public override bool Perform() { Guid webAppId = Web.Site.WebApplication.Id; bool result = true; SPSecurity.RunWithElevatedPrivileges(() => { try { LogMessage("Connecting to the database . . .", 2); var DAO = new ReportHelper.EPMData(Web.Site.ID); using (DAO.GetClientReportingConnection) { #region ViewCode DAO.GetClientReportingConnection.ExecuteNonQuery(@"IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE Name = N'PreviousPName' AND Object_ID = Object_ID(N'LSTProjectCenter')) BEGIN ALTER TABLE [LSTProjectCenter] ADD [PreviousPName] NVARCHAR(512) NULL; EXEC('UPDATE [LSTProjectCenter] SET [PreviousPName]=[TITLE];'); END"); #endregion LogMessage("New PreviousPName column sucessfully added to LSTProjectCenter.", MessageKind.SUCCESS, 4); } } catch (Exception exception) { string message = exception.InnerException != null ? exception.InnerException.Message : exception.Message; LogMessage(message, MessageKind.FAILURE, 4); result = false; } }); return(result); }
protected string mapReports(SPSite site) { string errors = ""; SPSecurity.RunWithElevatedPrivileges(delegate() { var reportData = new ReportHelper.ReportData( new Guid(site.ID.ToString()), txtDatabaseName.Text, txtDatabaseServer.Text, sacccount.Checked, username.Text, ReportHelper.EPMData.Encrypt(password.Text)); bool found = reportData.DatabaseExists(); ReportHelper.EPMData epmdata = new ReportHelper.EPMData(site.ID); bool reportingdone = epmdata.MapDataBase(site.ID, site.WebApplication.Id, txtDatabaseServer.Text, txtDatabaseName.Text, username.Text, password.Text, sacccount.Checked, found, out errors); if (reportingdone) { errors = ""; } }); return(errors); }