/// <summary> /// Removes moderator from message board. Called when the button "Remove moderator from board" is pressed. /// Expects the method AddModeratorToMessageBoard to be run first. /// </summary> private bool RemoveModeratorFromMessageBoard() { // Get the tree structure TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser); // Get the root document TreeNode root = tree.SelectSingleNode(SiteContext.CurrentSiteName, "/", null, true); if (root != null) { // Get the message board BoardInfo board = BoardInfoProvider.GetBoardInfo("MyNewBoard", root.DocumentID); if (board != null) { BoardModeratorInfo boardModerator = BoardModeratorInfoProvider.GetBoardModeratorInfo(MembershipContext.AuthenticatedUser.UserID, board.BoardID); if (boardModerator != null) { // Remove moderator from message board BoardModeratorInfoProvider.DeleteBoardModeratorInfo(boardModerator); return(true); } } } return(false); }
protected void CheckLocalPermissions() { int groupId = 0; int boardId = mBoardId; BoardMessageInfo bmi = BoardMessageInfoProvider.GetBoardMessageInfo(mMessageId); if (bmi != null) { boardId = bmi.MessageBoardID; } BoardInfo bi = BoardInfoProvider.GetBoardInfo(boardId); if (bi != null) { groupId = bi.BoardGroupID; } // Check 'Manage' permission if (MembershipContext.AuthenticatedUser.IsGroupAdministrator(groupId)) { return; } if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.groups", CMSAdminControl.PERMISSION_MANAGE)) { RedirectToAccessDenied("cms.groups", CMSAdminControl.PERMISSION_MANAGE); } }
/// <summary> /// Deletes message board subscription. Called when the "Delete subscription" button is pressed. /// Expects the CreateMessageBoardSubscription method to be run first. /// </summary> private bool DeleteMessageBoardSubscription() { // Get the tree structure TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser); // Get root document TreeNode root = tree.SelectSingleNode(SiteContext.CurrentSiteName, "/", null, true); if (root != null) { // Get the message board BoardInfo board = BoardInfoProvider.GetBoardInfo("MyNewBoard", root.DocumentID); if (board != null) { // Get the message board subscription BoardSubscriptionInfo deleteSubscription = BoardSubscriptionInfoProvider.GetBoardSubscriptionInfo(board.BoardID, MembershipContext.AuthenticatedUser.UserID); // Delete the message board subscription BoardSubscriptionInfoProvider.DeleteBoardSubscriptionInfo(deleteSubscription); return(deleteSubscription != null); } } return(false); }
/// <summary> /// Removes role from message board. Called when the button "Remove role from board" is pressed. /// Expects the method AddRoleToMessageBoard to be run first. /// </summary> private bool RemoveRoleFromMessageBoard() { // Get the tree structure TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser); // Get the root document TreeNode root = tree.SelectSingleNode(SiteContext.CurrentSiteName, "/", null, true); if (root != null) { // Get the message board BoardInfo board = BoardInfoProvider.GetBoardInfo("MyNewBoard", root.DocumentID); // Get the role RoleInfo role = RoleInfoProvider.GetRoleInfo("CMSDeskAdmin", SiteContext.CurrentSite.SiteID); if ((board != null) && (role != null)) { BoardRoleInfo boardRole = BoardRoleInfoProvider.GetBoardRoleInfo(role.RoleID, board.BoardID); if (boardRole != null) { // Remove role from message board BoardRoleInfoProvider.DeleteBoardRoleInfo(boardRole); return(true); } } } return(false); }
/// <summary> /// Gets and updates message board subscription. Called when the "Get and update subscription" button is pressed. /// Expects the CreateMessageBoardSubscription method to be run first. /// </summary> private bool GetAndUpdateMessageBoardSubscription() { // Get the tree structure TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser); // Get root document TreeNode root = tree.SelectSingleNode(SiteContext.CurrentSiteName, "/", null, true); if (root != null) { // Get the message board BoardInfo board = BoardInfoProvider.GetBoardInfo("MyNewBoard", root.DocumentID); if (board != null) { // Get the message board subscription BoardSubscriptionInfo updateSubscription = BoardSubscriptionInfoProvider.GetBoardSubscriptionInfo(board.BoardID, MembershipContext.AuthenticatedUser.UserID); if (updateSubscription != null) { // Update the properties updateSubscription.SubscriptionEmail = updateSubscription.SubscriptionEmail.ToLowerCSafe(); // Update the subscription BoardSubscriptionInfoProvider.SetBoardSubscriptionInfo(updateSubscription); return(true); } } } return(false); }
/// <summary> /// Returns the count of messages in given message board. /// </summary> /// <param name="documentId">ID of the document.</param> /// <param name="boardWebpartName">Messageboard webpart name.</param> /// <param name="type">Type of messageboard: 'document', 'user' or 'group'.</param> public static int GetBoardMessagesCount(int documentId, string boardWebpartName, string type) { // Get board type BoardOwnerTypeEnum boardType = BoardInfoProvider.GetBoardOwnerTypeEnum(type); Guid identifier = Guid.Empty; // Get correct identifier by type switch (boardType) { case BoardOwnerTypeEnum.User: identifier = CMSContext.CurrentUser.UserGUID; break; case BoardOwnerTypeEnum.Group: identifier = GetCurrentGroupGuid(); break; } // Get board name string boardName = BoardInfoProvider.GetMessageBoardName(boardWebpartName, boardType, identifier.ToString()); // Get board info BoardInfo board = BoardInfoProvider.GetBoardInfo(boardName, documentId); if (board != null) { // Get messages count return(BoardMessageInfoProvider.GetMessagesCount(board.BoardID, true, true)); } return(0); }
/// <summary> /// Deletes message. Called when the "Delete message" button is pressed. /// Expects the CreateMessage method to be run first. /// </summary> private bool DeleteMessage() { // Get the tree structure TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser); // Get the root document TreeNode root = tree.SelectSingleNode(SiteContext.CurrentSiteName, "/", null, true); if (root != null) { // Get the message board BoardInfo board = BoardInfoProvider.GetBoardInfo("MyNewBoard", root.DocumentID); if (board != null) { // Get the data DataSet messages = BoardMessageInfoProvider.GetMessages(board.BoardID); if (!DataHelper.DataSourceIsEmpty(messages)) { // Get the message BoardMessageInfo deleteMessage = new BoardMessageInfo(messages.Tables[0].Rows[0]); // Delete the message BoardMessageInfoProvider.DeleteBoardMessageInfo(deleteMessage); return(deleteMessage != null); } } } return(false); }
/// <summary> /// Creates message board subscription. Called when the "Create subscription" button is pressed. /// Expects the CreateMessageBoard method to be run first. /// </summary> private bool CreateMessageBoardSubscription() { // Create new message board subscription object BoardSubscriptionInfo newSubscription = new BoardSubscriptionInfo(); // Get the tree structure TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser); // Get root document TreeNode root = tree.SelectSingleNode(SiteContext.CurrentSiteName, "/", null, true); if (root != null) { // Get the message board BoardInfo board = BoardInfoProvider.GetBoardInfo("MyNewBoard", root.DocumentID); if (board != null) { // Set the properties newSubscription.SubscriptionBoardID = board.BoardID; newSubscription.SubscriptionUserID = MembershipContext.AuthenticatedUser.UserID; newSubscription.SubscriptionEmail = "*****@*****.**"; newSubscription.SubscriptionLastModified = DateTime.Now; // Create the message board subscription BoardSubscriptionInfoProvider.SetBoardSubscriptionInfo(newSubscription); return(true); } } return(false); }
/// <summary> /// Gets and updates message board. Called when the "Get and update board" button is pressed. /// Expects the CreateMessageBoard method to be run first. /// </summary> private bool GetAndUpdateMessageBoard() { // Get the tree structure TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser); // Get the root document TreeNode root = tree.SelectSingleNode(SiteContext.CurrentSiteName, "/", null, true); if (root != null) { // Get the message board BoardInfo updateBoard = BoardInfoProvider.GetBoardInfo("MyNewBoard", root.DocumentID); if (updateBoard != null) { // Update the property updateBoard.BoardDisplayName = updateBoard.BoardDisplayName.ToLowerCSafe(); // Update the message board BoardInfoProvider.SetBoardInfo(updateBoard); return(true); } } return(false); }
/// <summary> /// Gets and updates message. Called when the "Get and update message" button is pressed. /// Expects the CreateMessage method to be run first. /// </summary> private bool GetAndUpdateMessage() { // Get the tree structure TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser); // Get the root document TreeNode root = tree.SelectSingleNode(SiteContext.CurrentSiteName, "/", null, true); if (root != null) { // Get the message board BoardInfo board = BoardInfoProvider.GetBoardInfo("MyNewBoard", root.DocumentID); if (board != null) { // Get the data DataSet messages = BoardMessageInfoProvider.GetMessages(board.BoardID); if (!DataHelper.DataSourceIsEmpty(messages)) { // Create object from DataRow BoardMessageInfo updateMessage = new BoardMessageInfo(messages.Tables[0].Rows[0]); // Update the properties updateMessage.MessageText = updateMessage.MessageText.ToLowerCSafe(); // Update the message BoardMessageInfoProvider.SetBoardMessageInfo(updateMessage); return(true); } } } return(false); }
/// <summary> /// On action event handling. /// </summary> /// <param name="actionName">Name of the action.</param> /// <param name="actionArgument">Parameter for the action.</param> protected void boardSubscriptions_OnAction(string actionName, object actionArgument) { int boardSubscriptionId = ValidationHelper.GetInteger(actionArgument, 0); switch (actionName.ToLowerCSafe()) { case "delete": if (RaiseOnCheckPermissions(PERMISSION_MANAGE, this)) { if (StopProcessing) { return; } } try { BoardSubscriptionInfoProvider.DeleteBoardSubscriptionInfo(boardSubscriptionId); } catch (Exception ex) { ShowError(ex.Message); } break; case "approve": if (RaiseOnCheckPermissions(PERMISSION_MANAGE, this)) { if (StopProcessing) { return; } } // Approve BoardSubscriptionInfo object BoardSubscriptionInfo bsi = BoardSubscriptionInfoProvider.GetBoardSubscriptionInfo(boardSubscriptionId); if ((bsi != null) && !bsi.SubscriptionApproved) { bsi.SubscriptionApproved = true; BoardSubscriptionInfoProvider.SetBoardSubscriptionInfo(bsi); // Send confirmation mail BoardInfo bi = BoardInfoProvider.GetBoardInfo(bsi.SubscriptionBoardID); if ((bi != null) && bi.BoardSendOptInConfirmation) { BoardSubscriptionInfoProvider.SendConfirmationEmail(bsi, true); } // Log activity if (MembershipContext.AuthenticatedUser.UserID == UserID) { Service <ICurrentContactMergeService> .Entry().UpdateCurrentContactEmail(bsi.SubscriptionEmail, MembershipContext.AuthenticatedUser); BoardSubscriptionInfoProvider.LogSubscriptionActivity(bsi, bi, PredefinedActivityType.SUBSCRIPTION_MESSAGE_BOARD, false); } } break; } }
/// <summary> /// Adds role to message board. Called when the button "Add role to board" is pressed. /// Expects the method CreateMessageBoard to be run first. /// </summary> private bool AddRoleToMessageBoard() { // Get the tree structure TreeProvider tree = new TreeProvider(CMSContext.CurrentUser); // Get the root document TreeNode root = tree.SelectSingleNode(CMSContext.CurrentSiteName, "/", null, true); if (root != null) { // Get the message board BoardInfo board = BoardInfoProvider.GetBoardInfo("MyNewBoard", root.DocumentID); // Get the role CMSDeskAdmin RoleInfo role = RoleInfoProvider.GetRoleInfo("CMSDeskAdmin", CMSContext.CurrentSite.SiteID); if ((board != null) && (role != null)) { // Add role to message board BoardRoleInfoProvider.AddRoleToBoard(role.RoleID, board.BoardID); return(true); } } return(false); }
protected void Page_Load(object sender, EventArgs e) { // Get current board ID boardId = QueryHelper.GetInteger("boardid", 0); BoardInfo boardObj = BoardInfoProvider.GetBoardInfo(boardId); if (boardObj != null) { groupId = boardObj.BoardGroupID; // Check whether edited board belongs to group if (groupId == 0) { EditedObject = null; } } boardSubscriptions.BoardID = boardId; boardSubscriptions.GroupID = groupId; boardSubscriptions.OnCheckPermissions += new CMSAdminControl.CheckPermissionsEventHandler(boardSubscriptions_OnCheckPermissions); boardSubscriptions.OnAction += new CommandEventHandler(boardSubscriptions_OnAction); // Initialize the master page InitializeMasterPage(); }
/// <summary> /// Initializes the controls on the page. /// </summary> private void SetupControl() { // Get current subscription ID mSubscriptionId = QueryHelper.GetInteger("subscriptionid", 0); mCurrentSubscription = BoardSubscriptionInfoProvider.GetBoardSubscriptionInfo(mSubscriptionId); // Get current board and group ID boardId = QueryHelper.GetInteger("boardid", 0); groupId = QueryHelper.GetInteger("groupid", 0); BoardInfo boardObj = BoardInfoProvider.GetBoardInfo(boardId); if (boardObj != null) { // Check whether edited board belongs to group if ((boardObj.BoardGroupID == 0) || (groupId != boardObj.BoardGroupID)) { EditedObject = null; } } boardSubscription.IsLiveSite = false; boardSubscription.BoardID = boardId; boardSubscription.GroupID = groupId; boardSubscription.SubscriptionID = mSubscriptionId; boardSubscription.OnCheckPermissions += new CMSAdminControl.CheckPermissionsEventHandler(boardSubscription_OnCheckPermissions); boardSubscription.OnSaved += new EventHandler(boardSubscription_OnSaved); InitializeBreadcrumbs(); }
/// <summary> /// Initializes all the nested controls. /// </summary> private void SetupControls() { this.tabElem.TabControlIdPrefix = "boards"; this.tabElem.OnTabClicked += new EventHandler(tabElem_OnTabChanged); this.lnkEditBack.Text = GetString("Group_General.Boards.Boards.BackToList"); this.lnkEditBack.Click += new EventHandler(lnkEditBack_Click); // Register for the security events this.boardList.OnCheckPermissions += new CheckPermissionsEventHandler(boardList_OnCheckPermissions); this.boardEdit.OnCheckPermissions += new CheckPermissionsEventHandler(boardEdit_OnCheckPermissions); this.boardModerators.OnCheckPermissions += new CheckPermissionsEventHandler(boardModerators_OnCheckPermissions); this.boardSecurity.OnCheckPermissions += new CheckPermissionsEventHandler(boardSecurity_OnCheckPermissions); // Setup controls this.boardList.IsLiveSite = this.IsLiveSite; this.boardList.GroupID = this.GroupID; this.boardList.OnAction += new CommandEventHandler(boardList_OnAction); this.boardMessages.IsLiveSite = this.IsLiveSite; this.boardMessages.OnCheckPermissions += new CheckPermissionsEventHandler(boardMessages_OnCheckPermissions); this.boardMessages.BoardID = this.BoardID; this.boardMessages.GroupID = this.GroupID; this.boardMessages.EditPageUrl = (this.GroupID > 0) ? "~/CMSModules/Groups/CMSPages/Message_Edit.aspx" : "~/CMSModules/MessageBoards/CMSPages/Message_Edit.aspx"; this.boardEdit.IsLiveSite = this.IsLiveSite; this.boardEdit.BoardID = this.BoardID; this.boardEdit.DisplayMode = this.DisplayMode; this.boardModerators.IsLiveSite = this.IsLiveSite; this.boardModerators.BoardID = this.BoardID; this.boardSecurity.IsLiveSite = this.IsLiveSite; this.boardSecurity.BoardID = this.BoardID; this.boardSecurity.GroupID = this.GroupID; this.boardSubscriptions.IsLiveSite = this.IsLiveSite; this.boardSubscriptions.BoardID = this.BoardID; this.boardSubscriptions.GroupID = this.GroupID; // Initialize tab control string[,] tabs = new string[5, 4]; tabs[0, 0] = GetString("Group_General.Boards.Boards.Messages"); tabs[1, 0] = GetString("Group_General.Boards.Boards.Edit"); tabs[2, 0] = GetString("Group_General.Boards.Boards.Moderators"); tabs[3, 0] = GetString("Group_General.Boards.Boards.Security"); tabs[4, 0] = GetString("Group_General.Boards.Boards.SubsList"); this.tabElem.Tabs = tabs; // Initialize breadcrubms if (this.BoardID > 0) { board = BoardInfoProvider.GetBoardInfo(this.BoardID); if (board != null) { this.lblEditBack.Text = breadCrumbsSeparator + HTMLHelper.HTMLEncode(board.BoardDisplayName); } } }
/// <summary> /// Handles the UniGrid's OnAction event. /// </summary> /// <param name="actionName">Name of item (button) that throws event</param> /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param> protected void gridElem_OnAction(string actionName, object actionArgument) { BoardMessageInfo message = BoardMessageInfoProvider.GetBoardMessageInfo(Convert.ToInt32(actionArgument)); BoardInfo bi = BoardInfoProvider.GetBoardInfo(message.MessageBoardID); string[] argument = null; switch (actionName) { case "delete": case "approve": // Check whether user is board moderator first if (!BoardInfoProvider.IsUserAuthorizedToManageMessages(bi)) { // Then check modify to messageboards if (!CheckPermissions("cms.messageboards", CMSAdminControl.PERMISSION_MODIFY)) { return; } } break; } switch (actionName) { case "delete": if (message != null) { BoardMessageInfoProvider.DeleteBoardMessageInfo(message); } break; case "approve": if (message != null) { if (message.MessageApproved) { // Reject message message.MessageApproved = false; message.MessageApprovedByUserID = 0; } else { // Approve message message.MessageApproved = true; message.MessageApprovedByUserID = CMSContext.CurrentUser.UserID; } BoardMessageInfoProvider.SetBoardMessageInfo(message); } break; default: break; } this.RaiseOnAction(actionName, ((argument == null) ? actionArgument : argument)); }
private void boardSecurity_OnCheckPermissions(string permissionType, CMSAdminControl sender) { // Check 'Manage' permission int groupId = 0; BoardInfo bi = BoardInfoProvider.GetBoardInfo(boardId); if (bi != null) { groupId = bi.BoardGroupID; } CheckGroupPermissions(groupId, CMSAdminControl.PERMISSION_MANAGE); }
protected void Page_Load(object sender, EventArgs e) { int boardId = QueryHelper.GetInteger("boardid", 0); // Get board info and check whether it belongs to current site BoardInfo board = BoardInfoProvider.GetBoardInfo(boardId); if (board != null) { CheckMessageBoardSiteID(board.BoardSiteID); } boardModerators.Board = board; boardModerators.IsLiveSite = false; }
private void msgEdit_OnAfterMessageSaved(BoardMessageInfo message) { if ((bi == null) && (message != null) && (message.MessageBoardID > 0)) { MessageBoardID = message.MessageBoardID; // Get updated board information bi = BoardInfoProvider.GetBoardInfo(message.MessageBoardID); userVerified = BoardInfoProvider.IsUserAuthorizedToManageMessages(bi); } rptBoardMessages.ClearCache(); ReloadData(); }
protected void Page_Load(object sender, EventArgs e) { // Get board ID int boardId = QueryHelper.GetInteger("boardId", 0); // Get board info and check whether it belongs to current site BoardInfo board = BoardInfoProvider.GetBoardInfo(boardId); if (board != null) { CheckMessageBoardSiteID(board.BoardSiteID); } // Set board info to editing control boardEdit.Board = board; }
protected void Page_Load(object sender, EventArgs e) { boardObj = BoardInfoProvider.GetBoardInfo(QueryHelper.GetInteger("boardid", 0)); if (boardObj != null) { groupId = boardObj.BoardGroupID; // Check whether edited board belongs to any group if (groupId == 0) { EditedObject = null; } } boardEdit.OnCheckPermissions += new CMSAdminControl.CheckPermissionsEventHandler(boardEdit_OnCheckPermissions); }
private void messageEditElem_OnBeforeMessageSaved() { bool isOwner = false; BoardInfo board = BoardInfoProvider.GetBoardInfo(messageEditElem.MessageBoardID); if (board != null) { // Check if the current user is allowed to modify the message isOwner = BoardInfoProvider.IsUserAuthorizedToManageMessages(board); } if (!isOwner && !MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("CMS.MessageBoards", "Modify")) { RedirectToAccessDenied(GetString("board.messageedit.notallowed")); } }
private void messageEditElem_OnBeforeMessageSaved() { bool isOwner = false; BoardInfo board = BoardInfoProvider.GetBoardInfo(mBoardId); if (board != null) { // Check if the current user is allowed to modify the message isOwner = BoardInfoProvider.IsUserAuthorizedToManageMessages(board); } if (!isOwner && !MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("CMS.MessageBoards", CMSAdminControl.PERMISSION_MODIFY)) { RedirectToAccessDenied("cms.messageboards", CMSAdminControl.PERMISSION_MODIFY); } }
protected void Page_Load(object sender, EventArgs e) { // Get parametr from query string boardId = QueryHelper.GetInteger("boardid", 0); groupId = QueryHelper.GetInteger("groupid", 0); // Get board info and chceck whether it belongs to current site BoardInfo board = BoardInfoProvider.GetBoardInfo(boardId); if (board != null) { CheckMessageBoardSiteID(board.BoardSiteID); } boardSecurity.GroupID = groupId; boardSecurity.Board = board; boardSecurity.IsLiveSite = false; }
protected override void OnPreInit(EventArgs e) { base.OnPreInit(e); this.mBoardId = QueryHelper.GetInteger("boardId", 0); boardObj = BoardInfoProvider.GetBoardInfo(this.mBoardId); if (boardObj != null) { this.mGroupId = boardObj.BoardGroupID; // Check whether edited board belongs to any group if (this.mGroupId == 0) { EditedObject = null; } } }
private void boardSubscriptions_OnCheckPermissions(string permissionType, CMSAdminControl sender) { int groupId = 0; BoardInfo bi = BoardInfoProvider.GetBoardInfo(boardId); if (bi != null) { groupId = bi.BoardGroupID; // Check whether edited board belongs to any group if (groupId == 0) { EditedObject = null; } } CheckGroupPermissions(groupId, CMSAdminControl.PERMISSION_MANAGE); }
private BoardInfo GetDocumentMessageBoard() { var messageBoard = BoardInfoProvider.GetBoardInfo(GetBoardName(WebPartName, BoardOwnerTypeEnum.Document), CurrentPageInfo.DocumentID); // Backward compatibility with older Kentico versions (from V6.0 to V11.0) when board name was created only from WebPartName if (messageBoard == null) { messageBoard = BoardInfoProvider.GetBoardInfo(WebPartName, CurrentPageInfo.DocumentID); } // Backward compatibility with older Kentico V5.5 when unique board name was created from WebPartName and NodeGUID. // Back in changeset #23916 there was introduced unique board name based on NodeGUID. // However this was later removed in #39925 because using NodeGUID caused issue that message boards were not displayed on linked pages. if (messageBoard == null) { messageBoard = BoardInfoProvider.GetBoardInfo(WebPartName + "_doc_" + CurrentPageInfo.NodeGUID, CurrentPageInfo.DocumentID); } return(messageBoard); }
/// <summary> /// Gets and bulk updates message board subscriptions. Called when the "Get and bulk update subscriptions" button is pressed. /// Expects the CreateMessageBoardSubscription method to be run first. /// </summary> private bool GetAndBulkUpdateMessageBoardSubscriptions() { // Get the tree structure TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser); // Get the root document TreeNode root = tree.SelectSingleNode(SiteContext.CurrentSiteName, "/", null, true); if (root != null) { // Get the message board BoardInfo board = BoardInfoProvider.GetBoardInfo("MyNewBoard", root.DocumentID); if (board != null) { // Prepare the parameters string where = "SubscriptionBoardID = " + board.BoardID; // Get the data DataSet subscriptions = BoardSubscriptionInfoProvider.GetSubscriptions(where, null); if (!DataHelper.DataSourceIsEmpty(subscriptions)) { // Loop through the individual items foreach (DataRow subscriptionDr in subscriptions.Tables[0].Rows) { // Create object from DataRow BoardSubscriptionInfo modifySubscription = new BoardSubscriptionInfo(subscriptionDr); // Update the property modifySubscription.SubscriptionEmail = modifySubscription.SubscriptionEmail.ToUpper(); // Update the subscription BoardSubscriptionInfoProvider.SetBoardSubscriptionInfo(modifySubscription); } return(true); } } } return(false); }
/// <summary> /// Gets and bulk updates messages. Called when the "Get and bulk update messages" button is pressed. /// Expects the CreateMessage method to be run first. /// </summary> private bool GetAndBulkUpdateMessages() { // Get the tree structure TreeProvider tree = new TreeProvider(CMSContext.CurrentUser); // Get the root document TreeNode root = tree.SelectSingleNode(CMSContext.CurrentSiteName, "/", null, true); if (root != null) { // Get the message board BoardInfo board = BoardInfoProvider.GetBoardInfo("MyNewBoard", root.DocumentID); if (board != null) { // Prepare the parameters string where = "MessageBoardID = " + board.BoardID; // Get the data DataSet messages = BoardMessageInfoProvider.GetMessages(where, null); if (!DataHelper.DataSourceIsEmpty(messages)) { // Loop through the individual items foreach (DataRow messageDr in messages.Tables[0].Rows) { // Create object from DataRow BoardMessageInfo modifyMessage = new BoardMessageInfo(messageDr); // Update the property modifyMessage.MessageText = modifyMessage.MessageText.ToUpper(); // Update the message BoardMessageInfoProvider.SetBoardMessageInfo(modifyMessage); } return(true); } } } return(false); }
/// <summary> /// Initializes the breadcrumb header element of the master page. /// </summary> private void InitializeBreadcrumb() { string[,] breadcrumbs = new string[2, 3]; breadcrumbs[0, 0] = GetString("board.header.messageboards"); breadcrumbs[0, 1] = "~/CMSModules/Groups/Tools/MessageBoards/Boards/Board_List.aspx" + ((this.mGroupId > 0) ? "?groupid=" + this.mGroupId : ""); breadcrumbs[0, 2] = "_parent"; if (this.BoardID > 0) { breadcrumbs[1, 0] = BoardInfoProvider.GetBoardInfo(this.BoardID).BoardDisplayName; } else { breadcrumbs[1, 0] = GetString("board.header.newboard"); } breadcrumbs[1, 1] = ""; this.CurrentMaster.Title.Breadcrumbs = breadcrumbs; this.CurrentMaster.Title.HelpTopicName = "board_edit_messages"; this.CurrentMaster.Title.HelpName = "helpTopic"; }