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.檢視UC { public partial class 教學日誌暨異常狀況View : UserControlBase { private int 課程企劃編號 = 0; private int 課程序號 = 0; public override void DataBind() { base.DataBind(); string[] keyArr = 單號.Split('|'); if (keyArr.Length > 0) 課程企劃編號 = DAC.GetInt32(keyArr[0]); if (keyArr.Length > 1) 課程序號 = DAC.GetInt32(keyArr[1]); ds教學日誌.SelectParameters["課程企劃編號"].DefaultValue = 課程企劃編號.ToString(); ds教學日誌.SelectParameters["課程序號"].DefaultValue = 課程序號.ToString(); FormView1.DataBind(); } protected void ds教學日誌_ObjectCreating(object sender, ObjectDataSourceEventArgs e) { e.ObjectInstance = new DAC_教學日誌(ParentPage.conn); } protected void FormView1_DataBound(object sender, EventArgs e) { if (FormView1.DataItem == null) return; 訓練課程企劃List d1 = Dao訓練課程企劃.SelectOne(課程企劃編號); if (d1.Count > 0) { var ctl = FindControl(FormView1, "lb課程企劃編號"); if (ctl != null) ctl.Text = d1[0].顯示編號; } DAC_訓練課程內容 Dao訓練課程內容 = new DAC_訓練課程內容(ParentPage.conn); 訓練課程內容List d2 = Dao訓練課程內容.SelectOne(課程企劃編號, 課程序號); if (d2.Count > 0) { var ctl1 = FindControl(FormView1, "lb節次"); var ctl2 = FindControl(FormView1, "lb講師"); if (ctl1 != null) ctl1.Text = d2[0].節次.ToString(); if (ctl2 != null) ctl2.Text = Dao訓練課程企劃.Select選定講師名稱(課程企劃編號, 課程序號); } string[] 新欄位ID = { "lb觀察01", "lb觀察02", "lb觀察03", "lb觀察04", "lb觀察05", "lb觀察06", "lb觀察07", "lb觀察08", "lb觀察說明", "lb觀察紀錄1", "lb觀察紀錄2" }; foreach (string 控制項ID in 新欄位ID) { Label lb = FindControl