public void BindList() { //查看所有审核通过的留言和我自己提交的留言 string where = " and (ispass = 1 or msgname='" + UiCommon.UserLoginInfo.UserName + "') "; //string queryString = "&tid=" + Utility.Common.GetStringOfUrl("tid"); int counts; DataTable dt = new BLL.Feedback().PagerList(/*WebPager1.PageSize, WebPager1.CurrentPageIndex,*/ anpPageIndex.PageSize, PageIndex, out counts, where); anpPageIndex.RecordCount = counts; anpPageIndex.CurrentPageIndex = PageIndex; //WebPager1.ItemCount = counts; //WebPager1.UrlQueryString = queryString; rpList.DataSource = dt.DefaultView; rpList.DataBind(); }
protected void button5_ServerClick(object sender, EventArgs e) { /* * string name = Utility.Common.FilterString(txtName.Text); * string email = Utility.Common.FilterString(txtEmail.Text); * string title = Utility.Common.FilterString(txtTitle.Text); * string content = Utility.Common.FilterString(txtContent.Text);*/ string name = Server.HtmlEncode(Utility.Common.SqlEncode(txtName.Text)); string email = Utility.Common.FilterString(txtEmail.Text); string title = Server.HtmlEncode(Utility.Common.SqlEncode(txtTitle.Text)); string content = Server.HtmlEncode(Utility.Common.SqlEncode(txtContent.Text)); string verify = VerifyCode.Text; if (ValidCode.CurrentCode != verify) { CommonManager.Web.RegJs(this, "alert('温馨提示:验证码输入错误,请重新输入!');", true); return; } int iRows = new BLL.Feedback().Add(name, email, title, content, Utility.Common.RequestIP); if (iRows > 0) { if (UiCommon.UserLoginInfo.IsLogin) { Response.Redirect("/Manage/Feedbacks.aspx"); } else { CommonManager.Web.RegJs(this, "location.href='Service.aspx?success';", false); } } else { CommonManager.Web.RegJs(this, "location.href='Service.aspx?fail';", false); } //if (iRows > 0) //{ // lblMsg.Text = "留言提交成功!"+DateTime.Now; // if (UiCommon.UserLoginInfo.IsLogin) // { // Response.Redirect("/Manage/Feedbacks.aspx"); // } // else // { // txtName.Text = string.Empty; // txtEmail.Text = string.Empty; // txtTitle.Text = string.Empty; // txtContent.Text = string.Empty; // } //} //else //{ // lblMsg.Text = "抱歉,留言提交失败,可能是服务器繁忙,请稍候再试!"; //} }
public void BindList() { //�鿴�������ͨ�������Ժ����Լ��ύ������ string where = " and (ispass = 1 or msgname='" + UiCommon.UserLoginInfo.UserName + "') "; //string queryString = "&tid=" + Utility.Common.GetStringOfUrl("tid"); int counts; DataTable dt = new BLL.Feedback().PagerList(/*WebPager1.PageSize, WebPager1.CurrentPageIndex,*/ anpPageIndex.PageSize, PageIndex, out counts, where); anpPageIndex.RecordCount = counts; anpPageIndex.CurrentPageIndex = PageIndex; //WebPager1.ItemCount = counts; //WebPager1.UrlQueryString = queryString; rpList.DataSource = dt.DefaultView; rpList.DataBind(); }
protected void button5_ServerClick( object sender, EventArgs e ) { /* string name = Utility.Common.FilterString(txtName.Text); string email = Utility.Common.FilterString(txtEmail.Text); string title = Utility.Common.FilterString(txtTitle.Text); string content = Utility.Common.FilterString(txtContent.Text);*/ string name = Server.HtmlEncode( Utility.Common.SqlEncode( txtName.Text ) ); string email = Utility.Common.FilterString( txtEmail.Text ); string title = Server.HtmlEncode( Utility.Common.SqlEncode( txtTitle.Text ) ); string content = Server.HtmlEncode( Utility.Common.SqlEncode( txtContent.Text ) ); string verify = VerifyCode.Text; if (ValidCode.CurrentCode != verify) { CommonManager.Web.RegJs(this, "alert('��ܰ��ʾ����֤������������������룡');", true); return; } int iRows = new BLL.Feedback().Add( name, email, title, content, Utility.Common.RequestIP ); if( iRows > 0 ) { if( UiCommon.UserLoginInfo.IsLogin ) Response.Redirect( "/Manage/Feedbacks.aspx" ); else CommonManager.Web.RegJs( this, "location.href='Service.aspx?success';", false ); } else CommonManager.Web.RegJs( this, "location.href='Service.aspx?fail';", false ); //if (iRows > 0) //{ // lblMsg.Text = "�����ύ�ɹ�!"+DateTime.Now; // if (UiCommon.UserLoginInfo.IsLogin) // { // Response.Redirect("/Manage/Feedbacks.aspx"); // } // else // { // txtName.Text = string.Empty; // txtEmail.Text = string.Empty; // txtTitle.Text = string.Empty; // txtContent.Text = string.Empty; // } //} //else //{ // lblMsg.Text = "��Ǹ�������ύʧ�ܣ������Ƿ�������æ�����Ժ����ԣ�"; //} }