using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using WebLib; namespace Education.Forms.辦訓狀況 { public partial class 課程使用經費登錄 : FormBase { private DAC_課程經費 Dao課程經費; protected void Page_Load(object sender, EventArgs e) { FunctionName = "課程使用經費登錄"; Dao課程經費 = new DAC_課程經費(conn); if (IsPostBack) { Panel1.Visible = 訓練企劃搜尋.訓練企劃編號 > 0; if (Panel1.Visible) GridView1.DataBind(); } } protected void btnInsert_Click(object sender, EventArgs e) { if (!IsValid) return; 課程經費 newValue = new 課程經費(); newValue.訓練課程企劃編號 = 訓練企劃搜尋.訓練企劃編號; newValue.收支 = rbl收支.SelectedValue; newValue.金額 = DAC.GetInt32(txt金額.Text); newValue.摘要 = txt摘要.Text; Dao課程經費.InsertOne(newValue); txt金額.Text = ""; txt摘要.Text = ""; GridView1.DataBind(); } protected void ds已上課_ObjectCreating(object sender, ObjectDataSourceEventArgs e) { e.ObjectInstance = Dao訓練課程企劃; } protected void btn查詢1_Click(object sender, EventArgs e) { GridView1.DataBind(); } } }