void btnPublish_Click(object sender, EventArgs e) { Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); Tz888.BLL.LeaveMsg msgBLL = new Tz888.BLL.LeaveMsg(); Button btn = new Button(); string commentId = ""; btn = (Button)sender; commentId = btn.ID.Substring(btn.ID.LastIndexOf("_") + 1); if (btn.Text.Trim() == "公开留言") { model.IsAudit = 1; //btn.Text = "关闭留言"; Response.Write("<script language=javascript>alert('公开此留言!');</script>"); } else { model.IsAudit = 0; //btn.Text = "发布留言"; Response.Write("<script language=javascript>alert('关闭此留言!');</script>"); } model.CommentId = Convert.ToInt32(commentId); //model.AuditMan = Session["loginName"]; model.AuditMan = loginname; model.AuditTime = DateTime.Now; bool result = msgBLL.PublishManageLeaveMsg(model); //getList(); Response.Redirect("commentReceive.aspx"); }
void btnResOk_Click(object sender, EventArgs e) { Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); Tz888.BLL.LeaveMsg msgBLL = new Tz888.BLL.LeaveMsg(); Button btn = new Button(); string infoId = ""; string commentId = ""; btn = (Button)sender; string btnSubName = btn.ID.Substring(btn.ID.IndexOf("_") + 1); TextBox tbText = new TextBox(); tbText = (TextBox)btn.Parent.FindControl("txtRes_" + btnSubName); infoId = btn.ID.Substring(btn.ID.IndexOf("_") + 1, btn.ID.LastIndexOf("_") - btn.ID.IndexOf("_") - 1); commentId = btn.ID.Substring(btn.ID.LastIndexOf("_") + 1); model.CommentContent = tbText.Text; //当前用户名称 model.LoginName = loginname; // model.InfoID = Convert.ToInt32(infoId); model.FatherID = Convert.ToInt32(commentId); model.CommentTime = DateTime.Now; bool result = msgBLL.SetResponse(model); //Response.Redirect("commentReceive.aspx"); Response.Redirect("commentReceive.aspx?infoId=" + infoId + "&commentId=" + commentId + "&content=" + tbText.Text); }
protected void btnOk_Click(object sender, EventArgs e) { if (this.txtName.Text.Trim() == "") { Response.Write("<script>alert('姓名不能为空')</script>"); } if (this.txtComment.Text.Trim() == "") { Response.Write("<script>alert('评论不能为空')</script>"); } else { Tz888.BLL.LeaveMsg msgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); model.CommentTime = DateTime.Now; model.InfoID = infoID; model.FatherID = 0; model.CommentContent = this.txtComment.Text; //model.LoginName = loginname; model.LoginName = this.txtName.Text.Trim(); bool result = msgBll.SetResponse(model); Response.Write("<script>alert('留言成功')</script>"); this.txtComment.Text = ""; this.txtEmail.Text = ""; this.txtName.Text = ""; this.txtTel.Text = ""; } }
protected void btnOk_Click(object sender, EventArgs e) { string commentName = ""; if (isLogin) { commentName = strLoginName; //Response.Write("<script>alert('姓名不能为空')</script>"); } else { Tz888.Common.MessageBox.ShowAndHref("不能评论,请您登录后评论!", this.Request.Url.ToString()); return; } if (this.txtComment.Text.Trim() == "") { Tz888.Common.MessageBox.ShowAndHref("评论不能为空!", this.Request.Url.ToString()); } else { Tz888.BLL.LeaveMsg msgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); model.CommentTime = DateTime.Now; model.InfoID = infoId; model.FatherID = 0; model.CommentContent = this.txtComment.Text; //model.LoginName = loginname; model.LoginName = commentName; bool result = msgBll.SetResponse(model); Tz888.Common.MessageBox.ShowAndHref("留言成功", this.Request.Url.ToString()); this.txtComment.Text = ""; } }
public string AddComment(int infoId, string commentName, string telNum, string email, string commentText) { try { Tz888.BLL.LeaveMsg msgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); model.InfoID = infoId; model.LoginName = commentName.Trim(); model.CommentContent = commentText.Trim(); model.FatherID = 0; model.CommentTime = DateTime.Now; bool result = msgBll.SetResponse(model); if (result) { return("ok"); } else { return("failed"); } } catch (Exception e) { string err = e.Message.ToString(); return(err); } }
protected void brnPublic_Click(object sender, EventArgs e) { Tz888.BLL.LeaveMsg leaveMsgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); string userName = Page.User.Identity.Name; LinkButton btn = new LinkButton(); int Id; btn = (LinkButton)sender; Id = Convert.ToInt32(btn.CommandName.Trim()); if (btn.Text.Trim() == "公开留言") { model.IsAudit = 1; } else if (btn.Text.Trim() == "关闭留言") { model.IsAudit = 0; } model.CommentId = Id; model.AuditMan = loginname; model.AuditTime = DateTime.Now; bool result = leaveMsgBll.PublishManageLeaveMsg(model); getList(); }
//发布评论 public void SendComment() { string commentName = ""; Tz888.BLL.LeaveMsg msgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); model.CommentTime = DateTime.Now; model.InfoID = Convert.ToInt32(InfoID); model.FatherID = 0; model.CommentContent = this.txtContent.Text; model.LoginName = Page.User.Identity.Name; bool result = msgBll.SetResponse(model); if (result) { if (pageurl != "") { Response.Write("<script>parent.location.href='" + pageurl + "';</script>"); } else { lblMsg.Text = "评论提交成功!请等待审核!"; } } else { lblMsg.Text = "评论提交失败"; } }
protected void rptCommentForeList_ItemDataBound(object sender, RepeaterItemEventArgs e) { DataRowView view = e.Item.DataItem as DataRowView;//定义一个DataRowView的实例 int id = Convert.ToInt32(view["id"]); this.lbInfoTitle.Text = view["title"].ToString(); Tz888.BLL.LeaveMsg msgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg msg = new Tz888.Model.LeaveMsg(); Tz888.Model.LeaveMsg resMsg = new Tz888.Model.LeaveMsg(); string result = ""; Label lb = new Label(); LinkButton btn = new LinkButton(); msg = msgBll.GetComment(id, 0); if (msg != null) { //if (msg.IsResponse == 1) { Tz888.BLL.Conn dal = new Tz888.BLL.Conn(); string strWhere = ""; strWhere = "fatherId=" + id + ""; long i = 0; long j = 0; long k = 0; DataTable dt = dal.GetList("infocommentTab", "id", "commentContent", strWhere, "id", ref i, k, ref j); System.Web.UI.HtmlControls.HtmlContainerControl divOnline = (HtmlContainerControl)e.Item.FindControl("aReply"); if (dt != null && dt.Rows.Count > 0) { result = dt.Rows[0][0].ToString(); if (divOnline != null) { divOnline.Style.Add("display", "none"); } btn = (LinkButton)e.Item.FindControl("btnRes"); lb = (Label)e.Item.FindControl("ResView"); lb.Text = result; } else { if (divOnline != null) { divOnline.Style.Add("display", "block"); } } } } if (view["infoOwner"].ToString().Trim() != Page.User.Identity.Name) { System.Web.UI.HtmlControls.HtmlGenericControl divRes = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("aReply"); divRes.Style.Add("display", "none"); } }
protected void Page_Load(object sender, EventArgs e) { if (Page.User.Identity.Name != null && Page.User.Identity.Name.Trim() != "") { this.txtName.Value = Page.User.Identity.Name.Trim(); divLogin.Style.Add("display", "none"); } else { divLogin.Style.Add("display", "block"); } if (Request.QueryString["infoId"] != null && Request.QueryString["infoId"].ToString() != "") { infoId = Convert.ToInt32(Request.QueryString["infoId"]); long i = 1; long j = 1; long k = 1; Tz888.BLL.Conn dal = new Tz888.BLL.Conn(); string strWhere = "infoId='" + infoId + "'"; DataTable dt = dal.GetList("maininfoTab", "loginName", "loginName,infoTypeID", strWhere, "loginName", ref i, k, ref j); if (dt != null && dt.Rows.Count > 0) { loginname = dt.Rows[0][0].ToString(); string infotype = dt.Rows[0][1].ToString().Trim(); //switch (infotype) //{ // case "Capital": // h1.InnerText = "给投资方留言"; // break; // case "Project": // h1.InnerText = "给项目方留言"; // break; // case "Merchant": // h1.InnerText = "给招商机构留言"; // break; // default: // break; //} Tz888.BLL.LeaveMsg lvBll = new Tz888.BLL.LeaveMsg(); int count = lvBll.GetCount(infoId); string countModel = "<a href=\"http://member.topfo.com/helper/InfoComment/CommentForeList.aspx?id={0}\" target=\"_blank\">共有留言<span class=\"orange01\">{1}</span>条</a>"; if (count > 0) { this.ltCount.Text = string.Format(countModel, infoId.ToString(), count.ToString()); } else { this.ltCount.Text = ""; } } } }
void btnDelete_Click(object sender, EventArgs e) { Tz888.BLL.LeaveMsg msgBLL = new Tz888.BLL.LeaveMsg(); Button btn = new Button(); string commentId = ""; btn = (Button)sender; commentId = btn.ID.Substring(btn.ID.LastIndexOf("_") + 1); bool result = msgBLL.DeleteLeaveMsg(Convert.ToInt32(commentId), 0);//0 虚拟删除留言 1 永远删除留言 getList(); }
protected void brnDelete_Click(object sender, EventArgs e) { Tz888.BLL.LeaveMsg msgBLL = new Tz888.BLL.LeaveMsg(); LinkButton btn = new LinkButton(); int Id; btn = (LinkButton)sender; Id = Convert.ToInt32(btn.CommandName.Trim()); bool result = msgBLL.DeleteLeaveMsg(Id, 0);//0 虚拟删除留言 1 永远删除留言 getList(); }
public string moveMsg(string idList) { Tz888.BLL.LeaveMsg leaveMsgBll = new Tz888.BLL.LeaveMsg(); string[] s = idList.Split(','); for (int i = 0; i < s.Length; i++) { if (s[i].ToString() != "") { bool b = leaveMsgBll.RestoreLeaveMsg(Convert.ToInt32(s[i])); } } return("ok"); }
protected void rptCommentReceive_ItemDataBound(object sender, RepeaterItemEventArgs e) { DataRowView view = e.Item.DataItem as DataRowView;//定义一个DataRowView的实例 int id = Convert.ToInt32(view["id"]); Tz888.BLL.LeaveMsg msgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg msg = new Tz888.Model.LeaveMsg(); Tz888.Model.LeaveMsg resMsg = new Tz888.Model.LeaveMsg(); string result = ""; Label lb = new Label(); LinkButton btn = new LinkButton(); msg = msgBll.GetComment(id, 0); if (msgBll != null) { if (msg.IsResponse == 1) { Tz888.BLL.Conn dal = new Tz888.BLL.Conn(); string strWhere = ""; strWhere = "fatherId='" + id + "'"; long i = 1; long j = 1; long k = 1; DataTable dt = dal.GetList("infocommentTab", "id", "commentContent", strWhere, "id", ref i, k, ref j); if (dt != null && dt.Rows.Count > 0) { result = dt.Rows[0][0].ToString(); } System.Web.UI.HtmlControls.HtmlGenericControl divOnline = (HtmlGenericControl)e.Item.FindControl("divResView"); if (divOnline != null) { divOnline.Style.Add("display", "block"); } btn = (LinkButton)e.Item.FindControl("btnRes"); btn.Enabled = false; } else { System.Web.UI.HtmlControls.HtmlGenericControl divOnline = (HtmlGenericControl)e.Item.FindControl("divResView"); if (divOnline != null) { divOnline.Style.Add("display", "none"); } } } lb = (Label)e.Item.FindControl("ResView"); lb.Text = result; //return result; }
protected void btnRes_Click(object sender, EventArgs e) { Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); Tz888.BLL.LeaveMsg msgBLL = new Tz888.BLL.LeaveMsg(); model.CommentContent = this.commentRes.Text; //当前用户名称 model.LoginName = Page.User.Identity.Name;//"sunray"; // model.InfoID = infoId; model.FatherID = Convert.ToInt32(Request.QueryString["commentId"]); model.CommentTime = DateTime.Now; bool result = msgBLL.SetResponse(model); Response.Redirect("CommentReceive.aspx"); }
public string ToRecycle(string idList) { Tz888.BLL.LeaveMsg leaveMsgBll = new Tz888.BLL.LeaveMsg(); string userName = Page.User.Identity.Name; string[] s = idList.Split(','); for (int i = 0; i < s.Length; i++) { if (s[i].Trim() != "") { int Id = Convert.ToInt32(s[i].Trim()); leaveMsgBll.DeleteLeaveMsg(Id, 0); } } return("ok"); }
protected void btnDeleteSelect_Click(object sender, EventArgs e) { CheckBox chk; Label lb; Tz888.BLL.LeaveMsg leaveMsgBll = new Tz888.BLL.LeaveMsg(); for (int i = 0; i < this.rptCommentReceive.Items.Count; i++) { chk = (CheckBox)this.rptCommentReceive.Items[i].FindControl("chkCommentSelect"); lb = (Label)this.rptCommentReceive.Items[i].FindControl("lbCommentID"); if (chk.Checked) { leaveMsgBll.DeleteLeaveMsg(Convert.ToInt32(lb.Text), 0); } } getList(); }
public string ToReply(string strtmp) { Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); Tz888.BLL.LeaveMsg msgBLL = new Tz888.BLL.LeaveMsg(); string strComment = strtmp.Trim().Substring(strtmp.Trim().IndexOf("^") + 1); string strId = strtmp.Trim().Substring(0, strtmp.Trim().IndexOf("^")).Trim(); model.CommentContent = strComment; //当前用户名称 model.LoginName = "sunray";//Page.User.Identity.Name; // //model.InfoID = infoId; model.InfoID = 6612; model.FatherID = Convert.ToInt32(strId); model.CommentTime = DateTime.Now; bool result = msgBLL.SetResponse(model); return("ok"); }
//回复显示 public string view(object view) { int id = Convert.ToInt32(view); Tz888.BLL.LeaveMsg msgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg msg = new Tz888.Model.LeaveMsg(); Tz888.Model.LeaveMsg resMsg = new Tz888.Model.LeaveMsg(); string result = ""; //msg = msgBll.GetComment(id, 0); //if (msgBll != null) //{ // if (msg.IsResponse == 1) // { // Tz888.BLL.Conn dal = new Tz888.BLL.Conn(); // string strWhere = ""; // strWhere = "fatherId='" + id + "'"; // long i = 1; // long j = 1; // long k = 1; // DataTable dt = dal.GetList("infocommentTab", "id", "commentContent", strWhere, "id", ref i, k, ref j); // if (dt != null && dt.Rows.Count > 0) // { // result = dt.Rows[0][0].ToString(); // } // System.Web.UI.HtmlControls.HtmlGenericControl divOnline = (HtmlGenericControl)this.rptCommentReceive.FindControl("divResView"); // if (divOnline != null) // { // divOnline.Style.Add("display", "block"); // } // } // else // { // System.Web.UI.HtmlControls.HtmlGenericControl divOnline = (HtmlGenericControl)this.rptCommentReceive.FindControl("divResView"); // if (divOnline != null) // { // divOnline.Style.Add("display", "none"); // } // } //} return(result); }
public string ToPublic(string idList) { Tz888.BLL.LeaveMsg leaveMsgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); string userName = Page.User.Identity.Name; string[] s = idList.Split(','); for (int i = 0; i < s.Length; i++) { if (s[i].Trim() != "") { int Id = Convert.ToInt32(s[i].Trim()); model.CommentId = Id; model.IsAudit = 1; model.AuditMan = loginname; model.AuditTime = DateTime.Now; bool result = leaveMsgBll.PublishManageLeaveMsg(model); } } return("ok"); }
protected void btnPublist_Click(object sender, EventArgs e) { CheckBox chk; Label lb; Tz888.BLL.LeaveMsg leaveMsgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); for (int i = 0; i < this.rptCommentReceive.Items.Count; i++) { chk = (CheckBox)this.rptCommentReceive.Items[i].FindControl("chkCommentSelect"); lb = (Label)this.rptCommentReceive.Items[i].FindControl("lbCommentID"); if (chk.Checked) { model.CommentId = Convert.ToInt32(lb.Text.Trim()); //model.AuditMan = Session["loginName"]; model.AuditMan = loginname; model.AuditTime = DateTime.Now; bool result = leaveMsgBll.PublishManageLeaveMsg(model); } } }
//发布评论 public void SendComment() { string commentName = ""; Tz888.BLL.LeaveMsg msgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); model.CommentTime = DateTime.Now; model.InfoID = Convert.ToInt32(InfoID); model.FatherID = 0; model.CommentContent = this.txtContent.Text; model.LoginName = Page.User.Identity.Name; bool result = msgBll.SetResponse(model); if (result) { Tz888.Common.MessageBox.ShowAndHref("评论留言成功!", this.Request.Url.ToString()); } else { Tz888.Common.MessageBox.ShowAndHref("评论留言失败!", this.Request.Url.ToString()); } }