using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; using WebLib; using System.Linq; namespace Education.Forms.基本資料 { public partial class 講師基本資料 : FormBase { private bool fileOK = false; private int 新編號; private string 圖檔儲存路徑; private string 授課區域; protected string 目前講師編號; protected string 目前講師姓名; private bool canExport = false; protected void Page_Load(object sender, EventArgs e) { FunctionName = "講師基本資料"; 圖檔儲存路徑 = Server.MapPath(Education.PublicVariable.講師照片路徑); Form_View = FormView1; Grid_View = GridView1; FormView_DataSource = dsForm; GridView_DataSource = dsGrid; AddTabButton(MultiView1, 0, btnTab1); AddTabButton(MultiView1, 1, btnTab2); AddTabButton(MultiView1, 2, btnTab3); AddTabButton(MultiView1, 3, btnTab4); RegisterPostbackTrigger(btnExport); InitJSVar(); GetRights(); if (!IsPostBack) { ActivateTab(MultiView1, 0); } else { Grid_View.DataBind(); Form_View.DataBind(); gv講師外訓滿意度.DataBind(); } } protected void GetRights() { canExport = new MWEB().CheckRight(ProgramID.匯出基本資料, WRightName.Execute, UserId); hfCanExport.Value = (canExport ? "Y" : ""); } protected string Process授課區域(object o) { string[] arr = DAC.GetString(o).Split(','); string result = ""; foreach (string s in arr) { if (s != null && s.Length > 0) result += Get類別名稱("授課區域", s) + "/"; } if (result.Length > 0) result = result.Remove(result.Length - 1); return result; } protected override void FormView_DataBinding(object sender, EventArgs e) { base.FormView_DataBinding(sender, e); if (Form_View.CurrentMode == FormViewMode.Insert) { //AddPostbackTrigger("UpdatePanel1", Form_View.FindControl("btnSave")); } if (Form_View.CurrentMode == FormViewMode.Edit) { //AddPostbackTrigger("UpdatePanel1", Form_View.FindControl("btnSave")); } } protected override void FormView_InsertDataBound(object sender, EventArgs e) { RegisterPostbackTrigger(Form_View.FindControl("btnSave")); base.FormView_InsertDataBound(sender, e); FindControl(Form_View, "txt出生日期").Value = new DateTime(1980, 1, 1); } protected override void FormView_ReadOnlyDataBound(object sender, EventArgs e) { base.FormView_ReadOnlyDataBound(sender, e); int 編號 = 0; Label lb編號 = FindControl