private void AddPKZone(XmlDocument xmlDoc) { int num = DataConverter.CLng(GetNodeInnerText(xmlDoc, "//commentid")); if (num > 0) { CommentPKZoneInfo commentPKZoneInfo = new CommentPKZoneInfo(); commentPKZoneInfo.CommentId = num; commentPKZoneInfo.Content = GetNodeInnerText(xmlDoc, "//content"); commentPKZoneInfo.Position = DataConverter.CLng(GetNodeInnerText(xmlDoc, "//position")); commentPKZoneInfo.IP = this.GetClientIP(); commentPKZoneInfo.UpdateTime = DateTime.Now; if (string.IsNullOrEmpty(PEContext.Current.User.UserName)) { commentPKZoneInfo.UserName = "******"; } else { commentPKZoneInfo.UserName = PEContext.Current.User.UserName; } CommentPKZone.Add(commentPKZoneInfo); } if (num > 0) { this.XmlResponseWriter.WriteElementString("status", "ok"); } else { this.XmlResponseWriter.WriteElementString("status", "err"); } }
private void ShowPkZoneInfo(RepeaterItemEventArgs e, Label LblNetizen, Label LblNetizenContent, Label LblNetizenTime, Label LblNetizenIp) { CommentPKZoneInfo dataItem = (CommentPKZoneInfo)e.Item.DataItem; LblNetizen.Text = dataItem.UserName; LblNetizenContent.Text = dataItem.Content; LblNetizenTime.Text = dataItem.UpdateTime.ToString(); LblNetizenIp.Text = dataItem.IP; }
private void ShowPkZoneInfo(RepeaterItemEventArgs e, Label LblNetizen, Label LblNetizenContent, Label LblNetizenTime, Label LblNetizenIp, Label LblDelete) { CommentPKZoneInfo dataItem = (CommentPKZoneInfo)e.Item.DataItem; LblNetizen.Text = dataItem.UserName; LblNetizenContent.Text = dataItem.Content; LblNetizenTime.Text = dataItem.UpdateTime.ToString(); LblNetizenIp.Text = dataItem.IP; if (!string.IsNullOrEmpty(PEContext.Current.Admin.UserName)) { LblDelete.Text = "操作:<a href='" + AdminPage.AppendSecurityCode("CommentPKZoneManage.aspx?Action=Delete&PKId=" + dataItem.PKId.ToString() + "&CommentID=" + BasePage.RequestInt32("CommentID").ToString() + "&Title=" + BasePage.RequestString("Title")) + "' >删除</a>"; } }
private static CommentPKZoneInfo CommentPKZoneInfoFromDataReader(NullableDataReader rdr) { CommentPKZoneInfo info = new CommentPKZoneInfo(); info.PKId = rdr.GetInt32("PKId"); info.CommentId = rdr.GetInt32("CommentId"); info.Title = rdr.GetString("Title"); info.Content = rdr.GetString("Content"); info.IP = rdr.GetString("IP"); info.Position = rdr.GetInt32("Position"); info.UpdateTime = rdr.GetDateTime("UpdateTime"); info.UserName = rdr.GetString("UserName"); return(info); }
public void Add(CommentPKZoneInfo commentPKZoneInfo) { Parameters cmdParams = new Parameters(); cmdParams.AddInParameter("@PKId", DbType.Int32, commentPKZoneInfo.PKId); cmdParams.AddInParameter("@CommentId", DbType.Int32, commentPKZoneInfo.CommentId); cmdParams.AddInParameter("@Title", DbType.String, commentPKZoneInfo.Title); cmdParams.AddInParameter("@Content", DbType.String, commentPKZoneInfo.Content); cmdParams.AddInParameter("@IP", DbType.String, commentPKZoneInfo.IP); cmdParams.AddInParameter("@UpdateTime", DbType.DateTime, commentPKZoneInfo.UpdateTime); cmdParams.AddInParameter("@UserName", DbType.String, commentPKZoneInfo.UserName); cmdParams.AddInParameter("@Position", DbType.Int32, commentPKZoneInfo.Position); DBHelper.ExecuteProc("PR_Contents_CommentPK_Add", cmdParams); }
public CommentPKZoneInfo GetModelInfo(int pkId) { CommentPKZoneInfo info = null; Parameters cmdParams = new Parameters(); cmdParams.AddInParameter("@PKId", DbType.Int32, pkId); using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT * FROM PE_CommentPK WHERE PKId = @PKId", cmdParams)) { if (reader.Read()) { info = CommentPKZoneInfoFromDataReader(reader); } } return(info); }
protected void OkButton_Click(object sender, EventArgs e) { int num = BasePage.RequestInt32("CommentID"); int num2 = BasePage.RequestInt32("ID"); CommentPKZoneInfo commentPKZoneInfo = new CommentPKZoneInfo(); commentPKZoneInfo.CommentId = num; commentPKZoneInfo.Title = base.Request["ItemTitle"]; commentPKZoneInfo.Content = base.Request["ItemContent"]; commentPKZoneInfo.Position = DataConverter.CLng(base.Request["RadlPosition"]); commentPKZoneInfo.IP = PEContext.Current.UserHostAddress; commentPKZoneInfo.UpdateTime = DateTime.Now; if (!string.IsNullOrEmpty(PEContext.Current.User.UserName)) { commentPKZoneInfo.UserName = PEContext.Current.User.UserName; } else { commentPKZoneInfo.UserName = "******"; } CommentPKZone.Add(commentPKZoneInfo); DynamicPage.WriteSuccessMsg("<li>添加辩论成功!</li>", string.Concat(new object[] { "CommentPKZoneManage.aspx?Id=", num2, "&CommentID=", num.ToString(), "&Title=", base.Server.UrlEncode(base.Request["Title"]) })); }
protected void InitComment() { if (this.m_GeneralId == 0) { BaseUserControl.WriteErrMsg("<li>没有找到隶属信息评论,请返回!</li>"); } else { string s = BaseUserControl.RequestString("Title"); this.LblTitle.Text = s; string returnurl = this.ViewFile + "?GeneralID=" + this.m_GeneralId.ToString() + "&title=" + base.Server.UrlEncode(s); int commentId = BaseUserControl.RequestInt32("CommentID"); switch (BaseUserControl.RequestString("Action")) { case "Delete": if (Comment.Delete(commentId)) { BaseUserControl.WriteSuccessMsg("<li>删除指定信息评论成功!</li>", returnurl); } break; case "Audited": if (Comment.SetStatus(commentId, true)) { BaseUserControl.WriteSuccessMsg("<li>指定信息评论审核成功!</li>", returnurl); } break; case "UnAudited": if (Comment.SetStatus(commentId, false)) { BaseUserControl.WriteSuccessMsg("<li>已取消指定评论审核!</li>", returnurl); } break; case "Premier": if (Comment.Elite(commentId, true)) { BaseUserControl.WriteSuccessMsg("<li>设定指定评论精华成功!</li>", returnurl); } break; case "UnPremier": if (Comment.Elite(commentId, false)) { BaseUserControl.WriteSuccessMsg("<li>已取消指定评论精华!</li>", returnurl); } break; case "AddPKZone": { CommentPKZoneInfo commentPKZoneInfo = new CommentPKZoneInfo(); commentPKZoneInfo.CommentId = commentId; commentPKZoneInfo.Content = base.Request["ItemContent"]; commentPKZoneInfo.Position = DataConverter.CLng(base.Request["RadlPosition"]); commentPKZoneInfo.IP = PEContext.Current.UserHostAddress; commentPKZoneInfo.UpdateTime = DateTime.Now; commentPKZoneInfo.UserName = "******"; CommentPKZone.Add(commentPKZoneInfo); BaseUserControl.WriteSuccessMsg("<li>感谢您的参与,添加辩论成功!</li>", returnurl); break; } } this.CommentBindData(); } }
protected void Page_Load(object sender, EventArgs e) { string str5; this.Path = base.BasePath; this.Path = this.Page.Request.Url.Scheme + "://" + this.Page.Request.Url.Authority + this.Path; int commentId = BasePage.RequestInt32("CommentID"); int num2 = BasePage.RequestInt32("ID"); string s = base.Request["Title"]; if (((str5 = BasePage.RequestString("Action")) != null) && (str5 == "AddPKZone")) { CommentPKZoneInfo commentPKZoneInfo = new CommentPKZoneInfo(); commentPKZoneInfo.CommentId = commentId; commentPKZoneInfo.Content = base.Request["ItemContent"]; commentPKZoneInfo.Position = DataConverter.CLng(base.Request["RadlPosition"]); commentPKZoneInfo.IP = PEContext.Current.UserHostAddress; commentPKZoneInfo.UpdateTime = DateTime.Now; commentPKZoneInfo.UserName = "******"; CommentPKZone.Add(commentPKZoneInfo); DynamicPage.WriteSuccessMsg("<li>感谢您的参与,添加辩论成功!</li>", string.Concat(new object[] { "CommentPKZoneManage.aspx?Id=", num2, "&CommentID=", commentId.ToString(), "&Title=", base.Server.UrlEncode(s) })); } if (!base.IsPostBack) { if (commentId == 0) { DynamicPage.WriteErrMsg("<li>没有找到隶属信息评论,请返回!</li>", string.Concat(new object[] { "CommentPKZoneManage.aspx?Id=", num2, "&CommentID=", commentId.ToString(), "&Title=", base.Server.UrlEncode(s) })); } else { CommentInfo extendCommentInfo = Comment.GetExtendCommentInfo(commentId); if (extendCommentInfo.IsNull) { DynamicPage.WriteErrMsg("<li>没有找到隶属信息评论,请返回!</li>", string.Concat(new object[] { "CommentPKZoneManage.aspx?Id=", num2, "&CommentID=", commentId.ToString(), "&Title=", base.Server.UrlEncode(s) })); } else { string str2 = CommentPKZone.GetPKCount(commentId, 1).ToString(); string str3 = CommentPKZone.GetPKCount(commentId, -1).ToString(); string str4 = CommentPKZone.GetPKCount(commentId, 0).ToString(); this.LblTitle.Text = "<a href='" + base.BasePath + "Item/" + BasePage.RequestInt32("ID").ToString() + ".aspx'>" + s + "</a>"; this.LblUserName.Text = extendCommentInfo.UserName; this.LblContent.Text = extendCommentInfo.Content; this.LblTime.Text = extendCommentInfo.UpdateDateTime.ToString(); this.LblSustain.Text = str2; this.LblOppose.Text = str3; this.LblSustain2.Text = str2; this.LblOppose2.Text = str3; this.LblNeutralismNetizen.Text = str4; this.AgreePagerBindData(); this.OpposePagerBindData(); this.NeutralismPagerBindData(); this.LblItemTitle.Text = s; if (extendCommentInfo.Content.Length > 30) { this.LblItemContent.Text = extendCommentInfo.Content.Substring(0, 30) + ".."; } else { this.LblItemContent.Text = extendCommentInfo.Content; } if (!string.IsNullOrEmpty(PEContext.Current.User.UserName)) { this.LblState.Text = PEContext.Current.User.UserName; } else { this.LblState.Text = "匿名发表"; } } } } }
public static void Add(CommentPKZoneInfo commentPKZoneInfo) { commentPKZoneInfo.PKId = MaxCommentPKZoneId() + 1; dal.Add(commentPKZoneInfo); }