Files
thinkyu/branches/1150807/Forms/選課/ShowTeacherDetail.aspx.cs
T
sryang 577060bc78 chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore
- 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
2026-09-10 09:42:37 +08:00

54 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebLib;
using System.IO;
namespace Education.Forms.選課
{
public partial class ShowTeacherDetail : FormBase
{
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "講師詳情";
Form_View = FormView1;
FormView_DataSource = dsForm;
}
protected void dsForm_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao講師;
}
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");
}
}
}
}
}