chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore - 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
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 PlaceDetail : 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}_1.jpg", 編號)));
|
||||
image1.Style.Add("cursor", "pointer");
|
||||
}
|
||||
}
|
||||
|
||||
Image image2 = (Form_View.FindControl("Image2") as Image);
|
||||
if (image2 != null)
|
||||
{
|
||||
string[] tmp = image2.ImageUrl.Split('?');
|
||||
if (tmp.Length > 0 && !File.Exists(Server.MapPath(tmp[0])))
|
||||
{
|
||||
image2.ImageUrl = "~/picture/nopicture.jpg";
|
||||
image2.Attributes.Remove("onclick");
|
||||
image2.Style.Remove("cursor");
|
||||
}
|
||||
else
|
||||
{
|
||||
image2.Attributes.Add("onclick", GetOpenWindowJS("../Common/ShowLargePicture.aspx", "_picture", "pic", String.Format(Education.PublicVariable.場地照片路徑 + "{0:000000}_2.jpg", 編號)));
|
||||
image2.Style.Add("cursor", "pointer");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void dsForm_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
|
||||
{
|
||||
e.ObjectInstance = Dao場地;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user