コード例 #1
0
ファイル: HomePage.aspx.cs プロジェクト: vbea/Java21.NET
 protected void btnInsertAction_Click(object sender, EventArgs e)
 {
     string[] filds = new string[gdInsertView.Rows.Count];
     string[] strs  = new string[gdInsertView.Rows.Count];
     for (int i = 0; i < gdInsertView.Rows.Count; i++)
     {
         //Changed 2015.06.04
         //strs[i] = ((TextBox)gdInsertView.Rows[i].FindControl("txtDataValue")).Text;
         if (((TextBox)gdInsertView.Rows[i].FindControl("txtDataValue")).Enabled)
         {
             filds[i] = ((Label)gdInsertView.Rows[i].FindControl("labInsertColumn")).Text;
             strs[i]  = ((TextBox)gdInsertView.Rows[i].FindControl("txtDataValue")).Text;
         }
         else
         {
             filds[i] = "";
         }
     }
     getSconn();
     _bll = new ToolBll(Session["sConn"].ToString());
     if (_bll.InsertValue(getAbsoluteTableName(hidSchemasName.Value, hidTablesName.Value), filds, strs))
     {
         litInsertTip.Text = "新增成功!";
         litDetail.Text    = _bll.getTableCount(getAbsoluteTableName(hidSchemasName.Value, hidTablesName.Value));
     }
     else
     {
         litInsertTip.Text = "新增失败,请检查输入的数据类型是否匹配!";
     }
     Timer1.Enabled = true;
 }