protected void vwRequestModerator_ItemCommand(object sender, ListViewCommandEventArgs e)//处理申请版主 { string messageId = (vwRequestModerator.Items[e.Item.DataItemIndex].FindControl("hfldMessageId") as HiddenField).Value.Trim(); string memberId = (vwRequestModerator.Items[e.Item.DataItemIndex].FindControl("lblSender") as Label).Text.Trim(); Message message = new Message() { CreateTime = DateTime.Now, MessageId = MessageManagement.CreateMessageId(), MessageState = "未查看", MessageType = "普通", Recipient = memberId, Sender = "0000000000" }; if (e.CommandName == "Agree") { MessageManagement.Review(messageId); message.MessageText = "管理员同意了您的请求,你已经是版主了"; MessageManagement.Send(message); } else if (e.CommandName == "Disagree") { MessageManagement.Review(messageId); message.MessageText = "管理员拒绝了您的请求,申请版主失败"; MessageManagement.Send(message); } }
protected void btnReport_ServerClick(object sender, EventArgs e)//举报 { //举报,通过connectCriticism.value获取被举报的评论的id(举报的框在页面最下面,还没样式) //判断是否登录 SomeMethod.IfLogin(this); Message message = new Message() { Sender = Convert.ToString(Session["memberId"]), Recipient = "0000000000", MessageId = MessageManagement.CreateMessageId(), CreateTime = DateTime.Now, MessageType = "举报", MessageState = "未查看" }; //获取被举报者编号 if (connectCriticism.Value.Trim() == "Theme") { message.MessageText = "【主题" + Request["themeid"] + "】" + reportText.Value.Trim(); } else { message.MessageText = "【评论" + connectCriticism.Value.Trim() + "】" + reportText.Value.Trim(); } if (message.IsError) { Msg = "参数格式错误"; printMsgToClient(); return; } Msg = MessageManagement.Send(message); printMsgToClient(); }
protected void btnSend_Click(object sender, EventArgs e) { SomeMethod.IfLogin(this); Message message = new Message() { Sender = Convert.ToString(Session["memberId"]), Recipient = txtRecipient.Text.Trim(), MessageId = MessageManagement.CreateMessageId(), CreateTime = DateTime.Now, MessageType = "普通", MessageState = "未查看", MessageText = txtMsg.Text.Trim() }; SomeMethod.PrintMsgToClient(this.ClientScript, MessageManagement.Send(message)); }
protected void btnApply_Click(object sender, EventArgs e)//申请版主 { //判断是否登录 if (Session["memberId"] == null) { SomeMethod.PrintMsgToClient(this.ClientScript, "只有会员才能申请版主"); return; } if ((string)Session["role"] == "版主") { SomeMethod.PrintMsgToClient(this.ClientScript, "您已经是版主了,无法再申请"); return; } if ((string)Session["role"] == "管理员") { Msg = "管理员无需申请版主"; printMsgToClient(); return; } Message message = new Message() { CreateTime = DateTime.Now, MessageId = MessageManagement.CreateMessageId(), MessageState = "未查看", MessageText = "会员【" + Convert.ToString(Session["UserName"]) + "】申请成为【" + Convert.ToString(Request["divisionName"]) + "】版块的版主", MessageType = "申请版主", Recipient = "0000000000", Sender = Convert.ToString(Session["memberId"]) }; if (message.IsError) { Msg = "参数格式错误"; printMsgToClient(); return; } Msg = MessageManagement.Send(message); printMsgToClient(); Bind(); }
protected void btnResign_Click(object sender, EventArgs e)//辞去版主 { //判断是否登录 if ((string)Session["role"] != "版主") { Msg = "只有版主才能请求辞去版主职务,请登录版主账号!"; printMsgToClient(); return; } Message message = new Message() { CreateTime = DateTime.Now, MessageId = MessageManagement.CreateMessageId(), MessageState = "未查看", MessageText = "会员【" + Convert.ToString(Session["UserName"]) + "】申请辞去【" + Convert.ToString(Request["divisionName"]) + "】版块的版主", MessageType = "辞去版主", Recipient = "0000000000", Sender = Convert.ToString(Session["memberId"]) }; Msg = MessageManagement.Send(message); printMsgToClient(); Bind(); }