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 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 bool PublishManageLeaveMsg(Tz888.Model.LeaveMsg model) { bool result = false; SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.Int), new SqlParameter("@IsAudit", SqlDbType.TinyInt), new SqlParameter("@AuditMan", SqlDbType.VarChar, 16), new SqlParameter("@AuditTime", SqlDbType.SmallDateTime), }; parameters[0].Value = model.CommentId; parameters[1].Value = model.IsAudit; parameters[2].Value = model.AuditMan; parameters[3].Value = model.AuditTime; try { result = DbHelperSQL.RunProcLob("InfoCommentTabManager_update", parameters); } catch (Exception err) { throw err; } finally { } return(result); }
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); }
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"); }
//╥╒╡╪аТят╧эюМ public bool PublishManageLeaveMsg(Tz888.Model.LeaveMsg model) { bool result = false; result = dal.PublishManageLeaveMsg(model); return(result); }
public Tz888.Model.LeaveMsg ReadComment(int ID, int type) //0 ¶ÁÈ¡ÁôÑÔÐÅÏ¢ 1 ¶ÁÈ¡»Ø¸´ÁôÑÔ { Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); string tableName = ""; string selectCondition = ""; DataTable dt = new DataTable(); tableName = "InfoCommentManagerVIW"; if (type == 0) { selectCondition = "ID=" + ID.ToString(); } else if (type == 1) { selectCondition = "fatherID=" + ID.ToString(); } dt = coon.GetList(tableName, "CommentTime,CommentContent,IsAudit,IsDelete,IsResponse", "ID", 1, 1, 0, 1, selectCondition); if ((dt != null) && (dt.Rows.Count != 0)) { model.CommentTime = (DateTime)dt.Rows[0][0]; model.CommentContent = dt.Rows[0][1].ToString(); model.IsAudit = Convert.ToInt32(dt.Rows[0][2]); model.IsDelete = Convert.ToInt32(dt.Rows[0][3]); model.IsResponse = Convert.ToInt32(dt.Rows[0][4]); } return(model); //else //{ // model.IsResponse = false; // return model; //} }
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); } }
//发布评论 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 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; }
public bool SetResponse(Tz888.Model.LeaveMsg model) { bool result = false; SqlParameter[] parameters = { new SqlParameter("@infoId", SqlDbType.Int), new SqlParameter("@LoginName", SqlDbType.Char, 16), new SqlParameter("@NickName", SqlDbType.VarChar, 12), new SqlParameter("@CommentContent", SqlDbType.VarChar, 2000), new SqlParameter("@CommentTime", SqlDbType.SmallDateTime), new SqlParameter("@CommentIP", SqlDbType.VarChar, 30), new SqlParameter("@IsDelete", SqlDbType.Bit), new SqlParameter("@AuditRemark", SqlDbType.VarChar, 100), new SqlParameter("@AuditMan", SqlDbType.VarChar, 16), new SqlParameter("@AuditTime", SqlDbType.DateTime), new SqlParameter("@SendMailContent", SqlDbType.VarChar, 1000), new SqlParameter("@IsAudit", SqlDbType.TinyInt), new SqlParameter("@EvaluationScore", SqlDbType.Int), new SqlParameter("@FatherId", SqlDbType.BigInt), new SqlParameter("@IsResponse", SqlDbType.Bit), // }; parameters[0].Value = model.InfoID; parameters[1].Value = model.LoginName; parameters[2].Value = ""; parameters[3].Value = model.CommentContent; parameters[4].Value = model.CommentTime; parameters[5].Value = ""; parameters[6].Value = 0; parameters[7].Value = ""; parameters[8].Value = ""; parameters[9].Value = model.CommentTime;//ÉóºËʱ¼ä parameters[10].Value = " "; parameters[11].Value = 0; parameters[12].Value = 0; parameters[13].Value = model.FatherID; parameters[14].Value = 0;// try { result = DbHelperSQL.RunProcLob("InfoCommentTabManager_Insert", parameters); } catch (Exception err) { throw err; } finally { } 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 bool SetResponse(Tz888.Model.LeaveMsg model) { bool result = false; result = dal.SetResponse(model); #region аТят╩ь╦╢м╗ж╙ if (result) { string Contents = model.LoginName + "╩ь╦╢акдЗ╣двйт╢пео╒!"; string Title = "аТят╩ь╦╢м╗ж╙"; Noction.GetMaininfo(model.InfoID.ToString(), Contents, Title); } #endregion return(result); }
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()); } }
//╤ах║аТят public Tz888.Model.LeaveMsg GetComment(int ID, int type) //0 ╤ах║аТятпео╒ 1 ╤ах║╩ь╦╢аТят { Tz888.Model.LeaveMsg model = new Tz888.Model.LeaveMsg(); model = dal.ReadComment(ID, type); return(model); }