コード例 #1
0
    private void gvBind()
    {
        DataSet ds = typemanage.GetAllType("tb_type");

        gvBTypeInfo.DataSource   = ds;
        gvBTypeInfo.DataKeyNames = new string[] { "id" };
        gvBTypeInfo.DataBind();
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = "添加文献信息页面";
        if (!IsPostBack)
        {
            DataSet typeds = typemanage.GetAllType("tb_type");
            ddlType.DataSource    = typeds;
            ddlType.DataTextField = "categoryName";
            ddlType.DataBind();

            if (Request["title"] == null)
            {
                btnAdd.Enabled     = true;
                txtUploadtime.Text = DateTime.Now.ToShortDateString();
            }
            else
            {
                btnSave.Enabled = true;
                //txtBCode.ReadOnly = txtBName.ReadOnly = true;
                txtTitle.Text          = Request["title"].ToString();
                documentatmanage.Title = txtTitle.Text;
                DataSet documentatds = documentatmanage.FindDocumentatByTitle(documentatmanage, "tb_documentat");
                txtContent.Text = documentatds.Tables[0].Rows[0][2].ToString();
                //ddlBType.SelectedValue = bookds.Tables[0].Rows[0][2].ToString();
                txtKeyword.Text       = documentatds.Tables[0].Rows[0][3].ToString();
                txtAuthor.Text        = documentatds.Tables[0].Rows[0][4].ToString();
                txtTopic.Text         = documentatds.Tables[0].Rows[0][5].ToString();
                txtSummary.Text       = documentatds.Tables[0].Rows[0][6].ToString();
                txtReferences.Text    = documentatds.Tables[0].Rows[0][7].ToString();
                txtSource.Text        = documentatds.Tables[0].Rows[0][8].ToString();
                ddlType.SelectedValue = documentatds.Tables[0].Rows[0][9].ToString();
                txtDownloads.Text     = documentatds.Tables[0].Rows[0][10].ToString();
                txtUpload.Text        = documentatds.Tables[0].Rows[0][12].ToString();
                //txtCheck.Text = documentatds.Tables[0].Rows[0][13].ToString();
            }
        }
    }