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(); }
void Bind() { SomeMethod.IfLogin(this); DataTable dt = CriticismManagement.SelectCToC(Convert.ToString(Session["memberId"])); vwCriticism.DataSource = CriticismManagement.SelectCToC(Convert.ToString(Session["memberId"])); vwCriticism.DataBind(); }
void Bind() { SomeMethod.IfLogin(this.Page); DataTable dt = ConcernManagement.SelectMember(Convert.ToString(Session["memberId"])); vwConcern.DataSource = dt; vwConcern.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { SomeMethod.IfLogin(this.Page); if (!IsPostBack) { SomeMethod.IfLogin(this.Page); Bind(); } }
void Bind() { SomeMethod.IfLogin(this); dt = ThemeManagement.SelectMyCollect(Convert.ToString(Session["memberId"])); if (dt.Rows.Count == 0) { Msg = "暂未收藏任何主题"; printMsgToClient(); } lvTheme.DataSource = dt; lvTheme.DataBind(); }
void Bind() { SomeMethod.IfLogin(this); vwNotView.DataSource = MessageManagement.SelectByRecipient(Convert.ToString(Session["memberId"]), "未查看"); vwNotView.DataBind(); vwSend.DataSource = MessageManagement.SelectBySender(Convert.ToString(Session["memberId"])); vwSend.DataBind(); vwReview.DataSource = MessageManagement.SelectByRecipient(Convert.ToString(Session["memberId"]), "已查看"); vwReview.DataBind(); if (Request["recipient"] != null) { txtMemberId.Text = Convert.ToString(Request["recipient"]); } }
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 vwConcern_ItemCommand(object sender, ListViewCommandEventArgs e) { SomeMethod.IfLogin(this.Page); string memberId = (vwConcern.Items[e.Item.DataItemIndex].FindControl("hfldMemberId") as HiddenField).Value.Trim(); if (e.CommandName == "Cancal")//取消关注 { string Msg = ConcernManagement.UnConcern(Convert.ToString(Session["memberId"]), memberId); SomeMethod.PrintMsgToClient(this.ClientScript, Msg); Bind(); } else if (e.CommandName == "More") { Response.Redirect("~/Others.aspx?memberId=" + memberId); } }
protected void btnConcern_ServerClick(object sender, EventArgs e) { //判断是否登录 SomeMethod.IfLogin(this); //关注,通过connectCriticism.value获取被关注的会员的id if (Session["memberId"] != null) { Concern con = new Concern() { ConcernId = ConcernManagement.CreatConcernId(), ConcernMember = Session["memberId"].ToString().Trim(), ConcernTo = Request["memberId"].ToString().Trim() }; SomeMethod.PrintMsgToClient(this.ClientScript, ConcernManagement.AddConcern(con)); } }
protected void btnPubTheme_Click(object sender, EventArgs e) { //判断是否登录 SomeMethod.IfLogin(this.Parent.Page); Theme theme = new Theme() { BelongToDivision = ddlDivision.SelectedValue.Trim(), Clicks = 0, Creator = Convert.ToString(Session["memberId"]), IsEssence = false, IsSettop = false, PublishTime = DateTime.Now, ThemeId = ThemeManagement.CreateThemeId(), ThemeText = Server.UrlDecode(hidContent.Value.Trim()), Title = txtTitle.Text.Trim() }; printMsgToClient(ThemeManagement.CreateTheme(theme)); }
protected void lvMember_ItemCommand(object sender, ListViewCommandEventArgs e) { SomeMethod.IfLogin(this); string memberId = (lvMember.Items[e.Item.DataItemIndex].FindControl("hidMemberId") as HiddenField).Value.Trim(); if (e.CommandName == "Concern") { Concern con = new Concern() { ConcernId = ConcernManagement.CreatConcernId(), ConcernMember = Convert.ToString(Session["memberId"]), ConcernTo = memberId }; printMsgToClient(ConcernManagement.AddConcern(con)); } else if (e.CommandName == "MsgSend") { Response.Redirect("~/MyMessage.aspx?recipient=" + memberId); } }
protected void btnPubCriticism_Click(object sender, EventArgs e)//评论 { //判断是否登录 SomeMethod.IfLogin(this); Criticism criticism = new Criticism() { CriticismId = CriticismManagement.CreateCriticismId(), MemberId = Session["memberId"].ToString().Trim(), ThemeId = Request["themeId"].ToString(), CriticismText = Server.UrlDecode(hidContent.Value.Trim()), PublishTime = DateTime.Now }; if (connectCriticism.Value.Trim() == "Theme") { if (criticism.IsError) { Msg = "参数格式错误"; printMsgToClient(); return; } Msg = CriticismManagement.PublishCriticism(criticism); } else { criticism.ConnectedCriticism = connectCriticism.Value.Trim(); if (criticism.IsError) { Msg = "参数格式错误"; printMsgToClient(); return; } Msg = CriticismManagement.ReplyCriticism(criticism); } printMsgToClient(); Bind(); }