//=============================================================== // Function: messagesRepeater_ItemCommand //=============================================================== protected void messagesRepeater_ItemCommand(object sender, RepeaterCommandEventArgs e) { if( e.CommandName == "markAsReadButton" ) { int messageID = int.Parse(e.CommandArgument.ToString()); Message message = new Message(Session["loggedInUserFullName"].ToString(), messageID); message.messageRead = true; message.Update(); int userID = int.Parse(Session["loggedInUserID"].ToString()); PopulateMessageList(userID); } if (e.CommandName == "deleteButton") { int messageID = int.Parse(e.CommandArgument.ToString()); Message message = new Message(Session["loggedInUserFullName"].ToString(), messageID); message.Delete(); int userID = int.Parse(Session["loggedInUserID"].ToString()); PopulateMessageList(userID); } if (e.CommandName == "viewThreadButton") { int messageID = int.Parse(e.CommandArgument.ToString()); Message message = new Message(Session["loggedInUserFullName"].ToString(), messageID); if (message.parentMessageID > 0) { Response.Redirect("messageThread.aspx?MID=" + message.parentMessageID.ToString()); } else { Response.Redirect("messageThread.aspx?MID=" + messageID.ToString()); } } }
//=============================================================== // Function: messagesRepeater_ItemCommand //=============================================================== protected void messagesRepeater_ItemCommand(object sender, RepeaterCommandEventArgs e) { if( e.CommandName == "markAsReadButton" ) { int messageID = int.Parse(e.CommandArgument.ToString()); Message message = new Message(Session["loggedInUserFullName"].ToString(), messageID); message.messageRead = true; message.Update(); int userID = int.Parse(Session["loggedInUserID"].ToString()); PopulateMessageList(userID); } if (e.CommandName == "deleteButton") { int messageID = int.Parse(e.CommandArgument.ToString()); Message message = new Message(Session["loggedInUserFullName"].ToString(), messageID); message.Delete(); int userID = int.Parse(Session["loggedInUserID"].ToString()); PopulateMessageList(userID); } }