using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; using WebLib; namespace Education.Forms.基本資料 { public partial class TeacherDetail : FormBase { protected void Page_Load(object sender, EventArgs e) { FunctionName = "講師查詢"; Form_View = FormView1; } protected override void FormView_ReadOnlyDataBound(object sender, EventArgs e) { base.FormView_ReadOnlyDataBound(sender, e); int 編號 = 0; Label lb編號 = (Form_View.FindControl("lb編號") as Label); if (lb編號 != null) 編號 = DAC.GetInt32(lb編號.Text); Image image1 = (Form_View.FindControl("Image1") as Image); if (image1 != null) { string[] tmp = image1.ImageUrl.Split('?'); if (tmp.Length > 0 && !File.Exists(Server.MapPath(tmp[0]))) { image1.ImageUrl = "~/picture/nopicture.jpg"; image1.Attributes.Remove("onclick"); image1.Style.Remove("cursor"); } else { image1.Attributes.Add("onclick", GetOpenWindowJS("../Common/ShowLargePicture.aspx", "_picture", "pic", String.Format(Education.PublicVariable.講師照片路徑 + "{0:000000}.jpg", 編號))); image1.Style.Add("cursor", "pointer"); } } } protected void dsForm_ObjectCreating(object sender, ObjectDataSourceEventArgs e) { e.ObjectInstance = Dao講師; } } }