{$cfg_webname}
主页 > 计算机 > 论文 >

家教信息管理系统毕业论文设计(ASP.NET)(5)

来源:56doc.com  资料编号:5D4532 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9A5D4532
资料以网页介绍的为准,下载后不会有水印.资料仅供学习参考之用. 帮助
资料介绍

        }
        #endregionpublic partial class serach : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(TeacherManager .a ==1)
        {
            string txt = TeacherManager.b;
            RepSerach.DataSource = new TeacherManager().SelectCourseTeacher(txt);
            RepSerach.DataBind();
        }
        else
            if(TeacherManager .a ==2)
            {
                string txt = TeacherManager.b;
                RepSerach.DataSource = new TeacherManager().SelectAddressTeacher(txt);
                RepSerach.DataBind();
            }
            else
                if (TeacherManager .a ==3)
                {
                    string txt = TeacherManager.b;
                    RepSerach.DataSource = new TeacherManager().SelectPriceTeacher(txt);
                    RepSerach.DataBind();
                }
    }
}
5.2.4论坛功能模块的代码
public partial class PostList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {   // 第一次进入该页面时,绑定所有帖子
            rePost.DataSource = PostManager.SelectAllPost();
            rePost.DataBind();
        }
    }

    protected void btnBiuPost_Click(object sender, EventArgs e)
    {
        //验证验证码
        string code = txtCode.Text.Trim().ToUpper();
        string rightCode = Session["Code"].ToString();
        if (code != rightCode)
        {
            //弹出验证码输入错误后,页面不会出现空白
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('验证码输入错误!');</script>");
            return;
        }

        //添加进数据库
        string postTitle = txtPoTitle.Text;
        Model.Post P = new Model.Post(postTitle);
        bool b = PostManager.InsertPost(P);
        if (b)
        {
            //清空文本框
            txtPoTitle.Text = "";
            txtCode.Text = "";

            //重新绑定所有帖子
            rePost.DataSource = PostManager.SelectAllPost();
            rePost.DataBind();
推荐资料