private void BindGridList() { PN_CommentBLL commentbll = new PN_CommentBLL(); dgshow.DataSource = commentbll.GetUserList(Convert.ToInt32(ViewState["ID"])); dgshow.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int id = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]); PN_HasReadStaffBLL hasReadStaffbll = new PN_HasReadStaffBLL(); PN_CommentBLL commentbll = new PN_CommentBLL(); lab_hasRead.Text = hasReadStaffbll.GetReadCountByNotice(id).ToString(); lab_comment.Text = commentbll.GetCommentCountByNotice(id).ToString(); } }
protected void btn_submit_Click(object sender, EventArgs e) { PN_CommentBLL commentbll = new PN_CommentBLL(); commentbll.Model.Notice = Convert.ToInt32(ViewState["ID"]); commentbll.Model.Staff = int.Parse(Session["UserID"].ToString()); commentbll.Model.Content = content.Text; commentbll.Model.CommentTime = DateTime.Now; commentbll.Add(); BindGridList(); //清空评论板内的内容 content.Text = ""; }
/// <summary> /// 追加评论 /// </summary> /// <param name="AuthKey"></param> /// <param name="NoticeID"></param> /// <param name="CommentContent"></param> /// <returns></returns> public static int AddComment(UserInfo User, int NoticeID, string CommentContent) { LogWriter.WriteLog("NoticeService.AddComment:UserName="******",NoticeID=" + NoticeID.ToString() + ",CommentContent=" + CommentContent); if (User.AccountType == 1) { PN_CommentBLL commentbll = new PN_CommentBLL(); commentbll.Model.Notice = NoticeID; commentbll.Model.Staff = User.StaffID; commentbll.Model.Content = CommentContent + "[" + User.UserName + "]"; commentbll.Model.CommentTime = DateTime.Now; commentbll.Add(); } return(0); }
/// <summary> /// 追加评论 /// </summary> /// <param name="AuthKey"></param> /// <param name="NoticeID"></param> /// <param name="CommentContent"></param> /// <returns></returns> public static int AddComment(UserInfo User, int NoticeID, string CommentContent) { LogWriter.WriteLog("NoticeService.AddComment:UserName="******",NoticeID=" + NoticeID.ToString() + ",CommentContent=" + CommentContent); if (User.AccountType == 1) { PN_CommentBLL commentbll = new PN_CommentBLL(); commentbll.Model.Notice = NoticeID; commentbll.Model.Staff = User.StaffID; commentbll.Model.Content = CommentContent + "[" + User.UserName + "]"; commentbll.Model.CommentTime = DateTime.Now; commentbll.Add(); } return 0; }
private void BindGrid() { int approveflag; string CanComment; #region 显示公告主题内容 PN_NoticeBLL noticebll = new PN_NoticeBLL(Convert.ToInt32(ViewState["ID"])); lbl_Topic.Text = noticebll.Model.Topic.ToString(); lbl_content.Text = noticebll.Model.Content.ToString(); PN_HasReadStaffBLL hasReadStaffbll = new PN_HasReadStaffBLL(); PN_CommentBLL commentbll = new PN_CommentBLL(); lab_hasRead.Text = hasReadStaffbll.GetReadCountByNotice(Convert.ToInt32(ViewState["ID"])).ToString(); lab_comment.Text = commentbll.GetCommentCountByNotice(Convert.ToInt32(ViewState["ID"])).ToString(); insertstaff = int.Parse(noticebll.Model.InsertStaff.ToString()); lbl_InsertStaffName.Text = new Org_StaffBLL(insertstaff).Model.RealName; lbl_InsertTime.Text = noticebll.Model.InsertTime.ToString(); approveflag = noticebll.Model.ApproveFlag; //是否可以添加评论 CanComment = noticebll.Model.CanComment; //审核标志 ViewState["Catalog"] = noticebll.Model["Catalog"]; #endregion #region 展示附件 UploadFile1.RelateID = Convert.ToInt32(ViewState["ID"]); UploadFile1.BindGrid(); #endregion #region 初始化时折叠评论内容和评论板 //UpdatePanel1.Visible = false; #endregion #region 判断此公告是否可以评论 if (CanComment == "N") { btn_LookComment.Visible = false; } #endregion }