示例#1
0
    private void gvBind()
    {
        DataSet ds = documentatmanage.GetAllDocumentat("tb_documentat");

        gvDocumentatInfo.DataSource   = ds;
        gvDocumentatInfo.DataKeyNames = new string[] { "title" };
        gvDocumentatInfo.DataBind();
    }
示例#2
0
    protected void gvBind()
    {
        DataSet ds           = null;
        int     intCondition = ddlCondition.SelectedIndex;

        if (txtCondition.Text == "")
        {
            ds = documentatmanage.GetAllDocumentat("tb_documentat");
        }
        else
        {
            switch (intCondition)
            {
            case 0:
                documentatmanage.KeyWord = txtCondition.Text;
                ds = documentatmanage.FindDocumentatByKeyWord(documentatmanage, "tb_documentat");
                break;

            case 1:
                documentatmanage.Title = txtCondition.Text;
                ds = documentatmanage.FindDocumentatByTitle(documentatmanage, "tb_documentat");
                break;

            case 2:
                documentatmanage.Type = txtCondition.Text;
                ds = documentatmanage.FindDocumentatByType(documentatmanage, "tb_documentat");
                break;

            case 3:
                documentatmanage.Author = txtCondition.Text;
                ds = documentatmanage.FindDocumentatByAuthor(documentatmanage, "tb_documentat");
                break;

            case 4:
                documentatmanage.Topic = txtCondition.Text;
                ds = documentatmanage.FindDocumentatByTopic(documentatmanage, "tb_documentat");
                break;
            }
        }
        gvBookInfo.DataSource = ds;
        gvBookInfo.DataBind();
    }