chore: 首次簽入 Thinkyu ASP.NET 專案

- 加入 Visual Studio / ASP.NET .gitignore
- 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
2026-09-10 09:42:37 +08:00
commit 577060bc78
2496 changed files with 501389 additions and 0 deletions
@@ -0,0 +1,205 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/PopupForm.Master" AutoEventWireup="true" CodeBehind="PlaceDetail.aspx.cs" Inherits="Education.Forms.基本資料.PlaceDetail" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ObjectDataSource ID="dsForm" runat="server"
DataObjectTypeName="Education.場地" DeleteMethod="DeleteOne"
InsertMethod="InsertOne"
OldValuesParameterFormatString="original_{0}"
SelectMethod="SelectOne" TypeName="Education.DAC_場地"
UpdateMethod="UpdateOne" OnObjectCreating="dsForm_ObjectCreating">
<SelectParameters>
<asp:QueryStringParameter Name="編號" QueryStringField="id" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:FormView ID="FormView1" runat="server"
EnableModelValidation="True" DataKeyNames="編號,DB_APPNO"
DataSourceID="dsForm" EnableViewState="False">
<ItemTemplate>
<table border="0"
style="table-layout: fixed;">
<tr>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 270px;"></td>
<td colspan="1" class="widthcontrol" style="width: 270px;"></td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb編號Label" runat="server" Text="編號"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb編號" runat="server" Text='<%# Bind("編號", "{0:0000}") %>'
CssClass="inputFull"></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb單位名稱Label" runat="server" Text="單位名稱"></asp:Label>
</td>
<td class="datadisplay" colspan="3">
<asp:Label ID="lb單位名稱" runat="server" Text='<%# Bind("單位名稱") %>'
CssClass="inputFull"></asp:Label>
</td>
<td class="caption" style="text-align: center" colspan="2">
<asp:Label ID="lb照片一Label" runat="server"
Text="照片 (點擊圖片檢視大圖)"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb場地名稱Label" runat="server" Text="場地名稱"></asp:Label>
</td>
<td class="datadisplay" colspan="3">
<asp:Label ID="lb場地名稱" runat="server" Text='<%# Bind("場地名稱") %>'
CssClass="inputFull"></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb場地類型Label" runat="server" Text="場地類型"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb場地類型" runat="server" CssClass="inputFull"
Text='<%# Bind("場地類型") %>'></asp:Label>
</td>
<td rowspan="8"
style="text-align: center; vertical-align: top;">
<asp:Image ID="Image1" runat="server"
ImageUrl='<%# Education.PublicVariable.場地照片路徑 + "T_" + Eval("編號", "{0:000000}") + "_1.jpg?now=" + DateTime.UtcNow.AddHours(8).Ticks.ToString() %>' />
</td>
<td rowspan="8"
style="text-align: center; vertical-align: top;">
<asp:Image ID="Image2" runat="server"
ImageUrl='<%# Education.PublicVariable.場地照片路徑 + "T_" + Eval("編號", "{0:000000}") + "_2.jpg?now=" + DateTime.UtcNow.AddHours(8).Ticks.ToString() %>' />
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb價格Label" runat="server" Text="價格"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb價格" runat="server" CssClass="inputFull"
Text='<%# Bind("價格") %>'></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb坪數Label" runat="server" Text="坪數"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb坪數" runat="server" CssClass="inputFull" Text='<%# Bind("坪數") %>'></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb容納人數Label" runat="server" Text="容納人數"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb容納人數" runat="server" CssClass="inputFull"
Text='<%# Bind("容納人數") %>'></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb地址_郵編Label" runat="server" Text="地址"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Label ID="lb地址_郵編" runat="server" CssClass="input"
Text='<%# Bind("地址_郵編") %>'></asp:Label>
<asp:Label ID="lb地址_縣市" runat="server" CssClass="input"
Text='<%# Bind("地址_縣市") %>'></asp:Label>
<asp:Label ID="lb地址_鄉鎮市區" runat="server" CssClass="input"
Text='<%# Bind("地址_鄉鎮市區") %>'></asp:Label>
<asp:Label ID="lb地址_街道地址" runat="server" CssClass="input"
Text='<%# Bind("地址_街道地址") %>'></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb捷運可到Label" runat="server" Text="交通便利"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Panel ID="Panel1" runat="server" Style="display: inline;"
Visible='<%# Eval("捷運可到", "{0}") == "Y" %>'>
<asp:Label ID="lb捷運分鐘Label" runat="server" Text="捷運"></asp:Label>
<asp:Label ID="lb捷運分鐘" runat="server" CssClass="input"
Text='<%# Bind("捷運分鐘") %>'></asp:Label>
<asp:Label ID="Label5" runat="server" Text="分鐘&nbsp;&nbsp;"></asp:Label>
</asp:Panel>
<asp:Panel ID="Panel2" runat="server" Style="display: inline;"
Visible='<%# Eval("公車可到", "{0}") == "Y" %>'>
<asp:Label ID="lb公車可到Label" runat="server" Text="公車"></asp:Label>
<asp:Label ID="lb公車分鐘" runat="server" CssClass="input"
Text='<%# Bind("公車分鐘") %>'></asp:Label>
<asp:Label ID="Label6" runat="server" Text="分鐘&nbsp;&nbsp;"></asp:Label>
</asp:Panel>
<asp:Panel ID="Panel3" runat="server" Style="display: inline;"
Visible='<%# Eval("火車可到", "{0}") == "Y" %>'>
<asp:Label ID="lb火車可到Label0" runat="server" Text="火車"></asp:Label>
<asp:Label ID="lb火車分鐘" runat="server" CssClass="input"
Text='<%# Bind("火車分鐘") %>'></asp:Label>
<asp:Label ID="lb火車可到Label" runat="server" Text="分鐘&nbsp;&nbsp;"></asp:Label>
</asp:Panel>
<asp:Panel ID="Panel4" runat="server" Style="display: inline;"
Visible='<%# Eval("步行可到", "{0}") == "Y" %>'>
<asp:Label ID="lb步行可到Label" runat="server" Text="步行"></asp:Label>
<asp:Label ID="lb步行分鐘" runat="server" CssClass="input"
Text='<%# Bind("步行分鐘") %>'></asp:Label>
<asp:Label ID="lb步行分鐘Label" runat="server" Text="分鐘"></asp:Label>
</asp:Panel>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb設備提供Label" runat="server" Text="設備提供"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Label ID="lb設備提供" runat="server" CssClass="inputFull"
Text='<%# Eval("設備提供", "{0}").Replace("\r\n", "<br/>") %>'></asp:Label>
&nbsp;
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb聯絡人Label" runat="server" Text="聯絡人"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb聯絡人" runat="server" CssClass="inputFull"
Text='<%# Bind("聯絡人") %>'></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb聯絡人電話Label" runat="server" Text="電話"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb聯絡人電話" runat="server" CssClass="inputFull"
Text='<%# Bind("聯絡人電話") %>'></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb傳真Label" runat="server" Text="傳真"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb傳真" runat="server" CssClass="inputFull"
Text='<%# Bind("傳真") %>'></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb電子郵件Label" runat="server" Text="電子郵件"></asp:Label>
</td>
<td class="datadisplay" colspan="3">
<asp:Label ID="lb電子郵件" runat="server" CssClass="inputFull"
Text='<%# Bind("電子郵件") %>'></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb備註Label" runat="server" Text="備註"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Label ID="lb備註" runat="server" CssClass="inputFull"
Text='<%# Eval("備註", "{0}").Replace("\r", "<br/>") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:FormView>
</asp:Content>
@@ -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場地;
}
}
}
@@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class PlaceDetail
{
/// <summary>
/// dsForm 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource dsForm;
/// <summary>
/// FormView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.FormView FormView1;
}
}
@@ -0,0 +1,196 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/PopupForm.Master" AutoEventWireup="true" CodeBehind="TeacherDetail.aspx.cs" Inherits="Education.Forms.基本資料.TeacherDetail" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ObjectDataSource ID="dsForm" runat="server"
DataObjectTypeName="Education.講師" DeleteMethod="DeleteOne"
InsertMethod="InsertOne"
OldValuesParameterFormatString="original_{0}"
SelectMethod="SelectOne" TypeName="Education.DAC_講師"
UpdateMethod="UpdateOne" OnObjectCreating="dsForm_ObjectCreating">
<SelectParameters>
<asp:QueryStringParameter Name="編號" QueryStringField="id" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:FormView ID="FormView1" runat="server"
DataKeyNames="編號,DB_APPNO" DataSourceID="dsForm"
EnableModelValidation="True" EnableViewState="False">
<ItemTemplate>
<div>
<div style="float: left">
<table border="0" style="table-layout: fixed;">
<tr>
<td colspan="1" class="widthcontrol" style="width: 140px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 110px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb編號Label" runat="server" Text="編號"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb編號" runat="server" Text='<%# Bind("編號", "{0:0000}") %>'
CssClass="inputFull"></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb姓名Label" runat="server" Text="姓名"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb姓名" runat="server" Text='<%# Bind("姓名") %>'
CssClass="inputFull"></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb出生日期Label" runat="server" Text="出生日期"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb出生日期" runat="server" Text='<%# Eval("出生日期", "{0:yyyyMMdd}") %>'
CssClass="inputFull"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb性別Label" runat="server" Text="性別"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb性別" runat="server" Text='<%# Eval("性別", "{0}") == "M" ? "男" : "女" %>'
CssClass="inputFull"></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb身份證字號Label" runat="server" Text="身份證字號"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb身份證字號" runat="server" Text='<%# Bind("身份證字號") %>'
CssClass="inputFull"></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb電話Label" runat="server" Text="電話"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb電話" runat="server" Text='<%# Bind("電話") %>'
CssClass="inputFull"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb手機Label" runat="server" Text="手機"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb手機" runat="server" Text='<%# Bind("手機") %>'
CssClass="inputFull"></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb電子郵件Label" runat="server" Text="電子郵件"></asp:Label>
</td>
<td class="datadisplay" colspan="3">
<asp:Label ID="lb電子郵件" runat="server" Text='<%# Bind("電子郵件") %>'
CssClass="inputFull"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb戶籍地址Label" runat="server" Text="戶籍地址"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Label ID="lb戶籍地址_郵編" runat="server" Text='<%# Bind("戶籍地址_郵編") %>'
CssClass="input"></asp:Label>
<asp:Label ID="lb戶籍地址_縣市" runat="server" Text='<%# Bind("戶籍地址_縣市") %>'
CssClass="input"></asp:Label>
<asp:Label ID="lb戶籍地址_鄉鎮市區" runat="server" Text='<%# Bind("戶籍地址_鄉鎮市區") %>'
CssClass="input"></asp:Label>
<asp:Label ID="lb戶籍地址_街道地址" runat="server" Text='<%# Bind("戶籍地址_街道地址") %>'
CssClass="input"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb居住地址Label" runat="server" Text="居住地址"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Label ID="lb居住地址_郵編" runat="server" Text='<%# Bind("居住地址_郵編") %>'
CssClass="input"></asp:Label>
<asp:Label ID="lb居住地址_縣市" runat="server" Text='<%# Bind("居住地址_縣市") %>'
CssClass="input"></asp:Label>
<asp:Label ID="lb居住地址_鄉鎮市區" runat="server" Text='<%# Bind("居住地址_鄉鎮市區") %>'
CssClass="input"></asp:Label>
<asp:Label ID="lb居住地址_街道地址" runat="server" Text='<%# Bind("居住地址_街道地址") %>'
CssClass="input"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb現職Label" runat="server" Text="現職"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb現職" runat="server" Text='<%# Bind("現職") %>'
CssClass="inputFull"></asp:Label>
&nbsp;
</td>
<td class="caption">
<asp:Label ID="lb學歷Label" runat="server" Text="學歷"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb學歷" runat="server" Text='<%# Bind("學歷") %>'
CssClass="inputFull"></asp:Label>
&nbsp;
</td>
<td class="caption">
<asp:Label ID="lb授課區域Label" runat="server" Text="授課區域"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb授課區域" runat="server" Text='<%# Bind("授課區域") %>'
CssClass="inputFull"></asp:Label>
&nbsp;
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb授課專長領域Label" runat="server" Text="授課專長領域"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Label ID="lb授課專長領域" runat="server" Text='<%# Eval("授課專長領域", "{0}").Replace("\r\n", "<br>").Replace("\r", "<br>").Replace("\n", "<br>") %>'
CssClass="inputFull"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb授課經歷概述Label" runat="server" Text="授課經歷概述"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Label ID="lb授課經歷概述" runat="server" Text='<%# Eval("授課經歷概述", "{0}").Replace("\r\n", "<br>").Replace("\r", "<br>").Replace("\n", "<br>") %>'
CssClass="inputFull"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb重要經歷Label" runat="server" Text="重要經歷"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Label ID="lb重要經歷" runat="server" Text='<%# Eval("重要經歷", "{0}").Replace("\r\n", "<br>").Replace("\r", "<br>").Replace("\n", "<br>") %>'
CssClass="inputFull"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb重要研究與著作Label" runat="server" Text="重要研究與著作"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Label ID="lb重要研究與著作" runat="server" Text='<%# Eval("重要研究與著作", "{0}").Replace("\r\n", "<br>").Replace("\r", "<br>").Replace("\n", "<br>") %>'
CssClass="inputFull"></asp:Label>
</td>
</tr>
</table>
</div>
<div style="float: left; width: 400px; height: 280px; margin-left: 5px; text-align: center; vertical-align: middle;">
<asp:Image ID="Image1" runat="server"
ImageUrl='<%# Education.PublicVariable.講師照片路徑 + "T_" + Eval("編號", "{0:000000}") + ".jpg?now=" + DateTime.UtcNow.AddHours(8).Ticks.ToString() %>'
EnableViewState="False" />
</div>
</div>
</ItemTemplate>
</asp:FormView>
</asp:Content>
@@ -0,0 +1,52 @@
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講師;
}
}
}
@@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class TeacherDetail
{
/// <summary>
/// dsForm 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource dsForm;
/// <summary>
/// FormView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.FormView FormView1;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,354 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using WebLib;
namespace Education.Forms.
{
public partial class : FormBase
{
private bool fileOK = false;
private int ;
private string ;
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, btnSearchTab);
AddTabButton(MultiView1, 1, btnProcessTab);
if (!IsPostBack)
{
BindSearchDDL();
ActivateTab(MultiView1, 1);
}
else
{
Grid_View.DataBind();
Form_View.DataBind();
}
if (Form_View.CurrentMode != FormViewMode.ReadOnly)
{
Grid_View.Visible = false;
}
}
private void BindSearchDDL()
{
ddl場地地區.DataSource = Dao場地.Select地區ForDropDown();
ddl場地地區.DataTextField = "Name";
ddl場地地區.DataValueField = "Value";
ddl場地地區.DataBind();
ddl場地教室類型.DataSource = Dao場地.Select教室類型ForDropDown();
ddl場地教室類型.DataTextField = "Name";
ddl場地教室類型.DataValueField = "Value";
ddl場地教室類型.DataBind();
}
protected override void CalcFields(object sender, ObjectDataSourceMethodEventArgs e)
{
base.CalcFields(sender, e);
}
protected override void FormView_ReadOnlyDataBound(object sender, EventArgs e)
{
base.FormView_ReadOnlyDataBound(sender, e);
int = 0;
Label lb編號 = FindControl<Label>(Form_View, "lb編號");
if (lb編號 != null)
= DAC.GetInt32(lb編號.Text);
Image image1 = FindControl<Image>(Form_View, "Image1");
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 = FindControl<Image>(Form_View, "Image2");
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");
}
}
System.Data.DataTable 滿 = Dao場地.Select滿意度統計();
if (滿.Rows.Count > 0)
{
Label lb5分 = FindControl<Label>(Form_View, "lb5分");
Label lb4分 = FindControl<Label>(Form_View, "lb4分");
Label lb3分 = FindControl<Label>(Form_View, "lb3分");
Label lb2分 = FindControl<Label>(Form_View, "lb2分");
Label lb1分 = FindControl<Label>(Form_View, "lb1分");
Label lb總分 = FindControl<Label>(Form_View, "lb總分");
if (lb5分 != null)
lb5分.Text = DAC.GetString(滿.Rows[0]["場地滿意度5"]);
if (lb4分 != null)
lb4分.Text = DAC.GetString(滿.Rows[0]["場地滿意度4"]);
if (lb3分 != null)
lb3分.Text = DAC.GetString(滿.Rows[0]["場地滿意度3"]);
if (lb2分 != null)
lb2分.Text = DAC.GetString(滿.Rows[0]["場地滿意度2"]);
if (lb1分 != null)
lb1分.Text = DAC.GetString(滿.Rows[0]["場地滿意度1"]);
if (lb總分 != null)
lb總分.Text = String.Format("{0:##0.00}", 滿.Rows[0]["場地滿意度總分"]);
}
RegisterPostbackTrigger(Form_View.FindControl("btnUploadPhoto1"));
RegisterPostbackTrigger(Form_View.FindControl("btnUploadPhoto2"));
}
protected override void FormView_InsertDataBound(object sender, EventArgs e)
{
base.FormView_InsertDataBound(sender, e);
FormViewSetControlValue("txt價格", "0");
FormViewSetControlValue("txt坪數", "0");
FormViewSetControlValue("txt容納人數", "0");
FormViewSetControlValue("txt捷運分鐘", "0");
FormViewSetControlValue("txt公車分鐘", "0");
FormViewSetControlValue("txt火車分鐘", "0");
FormViewSetControlValue("txt步行分鐘", "0");
}
protected override void FormView_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
base.FormView_ItemInserted(sender, e);
//FileUpload fu1 = Form_View.FindControl("fuPhoto1") as FileUpload;
//FileUpload fu2 = Form_View.FindControl("fuPhoto2") as FileUpload;
// 儲存照片與縮圖(fu1, fu2, 新編號);
BindSearchDDL();
}
protected override void FormView_ItemUpdated(object sender, FormViewUpdatedEventArgs e)
{
base.FormView_ItemUpdated(sender, e);
//FileUpload fu1 = Form_View.FindControl("fuPhoto1") as FileUpload;
//FileUpload fu2 = Form_View.FindControl("fuPhoto2") as FileUpload;
//儲存照片與縮圖(fu1, fu2, DAC.GetInt32(e.Keys["編號"]));
BindSearchDDL();
}
protected override void FormView_ItemDeleting(object sender, FormViewDeleteEventArgs e)
{
base.FormView_ItemDeleting(sender, e);
if (Dao場地.IsOccipued(DAC.GetInt32(e.Keys["編號"])))
{
ClientShowMessage("此場地已經選用過,不可刪除!");
e.Cancel = true;
}
}
protected override void FormView_ItemDeleted(object sender, FormViewDeletedEventArgs e)
{
base.FormView_ItemDeleted(sender, e);
// 刪除縮圖與大圖
string s1 = String.Format("{0}T_{1:000000}_1.jpg", , e.Keys["編號"]);
string s2 = String.Format("{0}T_{1:000000}_2.jpg", , e.Keys["編號"]);
string s3 = String.Format("{0}{1:000000}_1.jpg", , e.Keys["編號"]);
string s4 = String.Format("{0}{1:000000}_2.jpg", , e.Keys["編號"]);
if (File.Exists(s1))
File.Delete(s1);
if (File.Exists(s2))
File.Delete(s2);
if (File.Exists(s3))
File.Delete(s3);
if (File.Exists(s4))
File.Delete(s4);
BindSearchDDL();
}
protected override void FormView_DataSource_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
{
base.FormView_DataSource_Inserted(sender, e);
= DAC.GetInt32(e.ReturnValue);
}
protected override void FormView_ItemCommand(object sender, FormViewCommandEventArgs e)
{
base.FormView_ItemCommand(sender, e);
if (e.CommandName == "刪除圖片1")
{
string s1 = String.Format("{0}T_{1:000000}_1.jpg", , DAC.GetInt32(e.CommandArgument));
string s3 = String.Format("{0}{1:000000}_1.jpg", , DAC.GetInt32(e.CommandArgument));
if (File.Exists(s1))
File.Delete(s1);
if (File.Exists(s3))
File.Delete(s3);
Form_View.DataBind();
}
if (e.CommandName == "刪除圖片2")
{
string s2 = String.Format("{0}T_{1:000000}_2.jpg", , DAC.GetInt32(e.CommandArgument));
string s4 = String.Format("{0}{1:000000}_2.jpg", , DAC.GetInt32(e.CommandArgument));
if (File.Exists(s2))
File.Delete(s2);
if (File.Exists(s4))
File.Delete(s4);
Form_View.DataBind();
}
if (e.CommandName == "上傳照片1")
{
FileUpload fu = FindControl<FileUpload>(Form_View, "fuPhoto1");
CheckPhoto(fu, out fileOK);
(fu, DAC.GetInt32(e.CommandArgument), 1);
Form_View.DataBind();
}
if (e.CommandName == "上傳照片2")
{
FileUpload fu = FindControl<FileUpload>(Form_View, "fuPhoto2");
CheckPhoto(fu, out fileOK);
(fu, DAC.GetInt32(e.CommandArgument), 2);
Form_View.DataBind();
}
}
protected override void GridView_DataSource_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
base.GridView_DataSource_Selected(sender, e);
if (MultiView1.ActiveViewIndex == 0)
{
if (e.ReturnValue is List list && list.Count > 0)
ActivateTab(MultiView1, 1);
else
lbMessage.Text = "找不到合乎條件的資料";
}
}
protected void (FileUpload fu1, int , int )
{
if (fileOK)
{
string tFullName = String.Format("{0}T_{1:000000}_{2}.jpg", , , );
MemoryStream ms = PictureProcess.(fu1.PostedFile.InputStream, 300, 300);
File.WriteAllBytes(tFullName, ms.ToArray());
ms.Dispose();
tFullName = String.Format("{0}{1:000000}_{2}.jpg", , , );
ms = PictureProcess.(fu1.PostedFile.InputStream, 1200, 1200);
File.WriteAllBytes(tFullName, ms.ToArray());
ms.Dispose();
}
/*
if (file2OK)
{
string tFullName = String.Format("{0}T_{1:000000}_2.jpg", 圖檔儲存路徑, 編號);
MemoryStream ms = PictureProcess.縮圖(fu2.PostedFile.InputStream, 270, 270);
File.WriteAllBytes(tFullName, ms.ToArray());
ms.Dispose();
tFullName = String.Format("{0}{1:000000}_2.jpg", 圖檔儲存路徑, 編號);
ms = PictureProcess.縮圖(fu2.PostedFile.InputStream, 1200, 1200);
File.WriteAllBytes(tFullName, ms.ToArray());
ms.Dispose();
}
*/
}
protected void cvPhoto1_ServerValidate(object source, ServerValidateEventArgs args)
{
FileUpload fu = FindControl<FileUpload>(Form_View, "fuPhoto1");
args.IsValid = CheckPhoto(fu, out fileOK);
}
protected void cvPhoto2_ServerValidate(object source, ServerValidateEventArgs args)
{
FileUpload fu = FindControl<FileUpload>(Form_View, "fuPhoto2");
args.IsValid = CheckPhoto(fu, out fileOK);
}
protected bool CheckPhoto(FileUpload fu, out bool fileOK)
{
// 處理上傳照片
string ext = "";
fileOK = false;
if (fu.HasFile && fu.PostedFile.ContentType.ToLower().IndexOf("image") >= 0)
{
// 檢查副檔名
ext = Path.GetExtension(fu.FileName).ToLower();
String[] allowedExt = { ".gif", ".jpeg", ".jpg", ".png" };
for (int i = 0; i < allowedExt.Length; i++)
{
if (ext == allowedExt[i])
{
fileOK = true;
}
}
// 檢查檔案大小
if (fileOK && fu.PostedFile.ContentLength < 5242880)
fileOK = true;
else
fileOK = false;
return fileOK;
}
else
{
return false;
}
}
protected void btnSearch_Click(object sender, EventArgs e)
{
Grid_View.PageIndex = 0;
Grid_View.DataBind();
}
protected void btnClear_Click(object sender, EventArgs e)
{
ddl場地地區.SelectedValue = "";
txt場地價格1.Text = "";
txt場地價格2.Text = "";
txt場地人數1.Text = "";
txt場地人數2.Text = "";
ddl場地教室類型.SelectedValue = "";
txt場地滿意度1.Text = "";
txt場地滿意度2.Text = "";
}
protected void dsForm_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao場地;
}
}
}
@@ -0,0 +1,278 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class
{
/// <summary>
/// btnProcessTab 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnProcessTab;
/// <summary>
/// btnSearchTab 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnSearchTab;
/// <summary>
/// MultiView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.MultiView MultiView1;
/// <summary>
/// View查詢 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.View View查詢;
/// <summary>
/// Label10 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label10;
/// <summary>
/// ddl場地地區 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.WDropDownList ddl場地地區;
/// <summary>
/// Label11 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label11;
/// <summary>
/// txt場地價格1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt場地價格1;
/// <summary>
/// Label15 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label15;
/// <summary>
/// txt場地價格2 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt場地價格2;
/// <summary>
/// Label12 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label12;
/// <summary>
/// txt場地人數1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt場地人數1;
/// <summary>
/// Label16 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label16;
/// <summary>
/// txt場地人數2 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt場地人數2;
/// <summary>
/// Label24 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label24;
/// <summary>
/// ddl場地教室類型 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.WDropDownList ddl場地教室類型;
/// <summary>
/// Label14 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label14;
/// <summary>
/// txt場地滿意度1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt場地滿意度1;
/// <summary>
/// Label17 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label17;
/// <summary>
/// txt場地滿意度2 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt場地滿意度2;
/// <summary>
/// btnSearch 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnSearch;
/// <summary>
/// btnClear 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnClear;
/// <summary>
/// lbMessage 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbMessage;
/// <summary>
/// View處理 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.View View處理;
/// <summary>
/// dsForm 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource dsForm;
/// <summary>
/// dsGrid 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource dsGrid;
/// <summary>
/// FormView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.FormView FormView1;
/// <summary>
/// GridView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView GridView1;
/// <summary>
/// View照片 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.View View照片;
}
}
@@ -0,0 +1,218 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true" CodeBehind="查詢作業.aspx.cs" Inherits="Education.Forms.基本資料.查詢作業" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ObjectDataSource ID="ds場地" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="查詢作業" TypeName="Education.DAC_場地">
<SelectParameters>
<asp:Parameter DefaultValue="false" Name="noInputReturnAll" Type="Boolean" />
<asp:ControlParameter ControlID="ddl場地地區" DefaultValue="" Name="地區" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="txt場地價格1" Name="價格1" PropertyName="Text" Type="Int32" />
<asp:ControlParameter ControlID="txt場地價格2" Name="價格2" PropertyName="Text" Type="Int32" />
<asp:ControlParameter ControlID="txt場地人數1" Name="人數1" PropertyName="Text" Type="Int32" />
<asp:ControlParameter ControlID="txt場地人數2" Name="人數2" PropertyName="Text" Type="Int32" />
<asp:ControlParameter ControlID="ddl場地教室類型" Name="場地類型" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="txt場地滿意度1" Name="滿意度1" PropertyName="Text" Type="Int32" />
<asp:ControlParameter ControlID="txt場地滿意度2" Name="滿意度2" PropertyName="Text" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ds講師" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="查詢作業" TypeName="Education.DAC_講師">
<SelectParameters>
<asp:Parameter DefaultValue="false" Name="noInputReturnAll" Type="Boolean" />
<asp:ControlParameter ControlID="ddl講師地區" DefaultValue="" Name="地區" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="txt講師專長" Name="專長" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txt講師學歷" Name="學歷" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txt講師滿意度1" Name="滿意度1" PropertyName="Text" Type="Int32" />
<asp:ControlParameter ControlID="txt講師滿意度2" Name="滿意度2" PropertyName="Text" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<table>
<tr>
<td class="captionCenter" colspan="4">
<asp:Label ID="Label9" runat="server" Text="場地查詢"></asp:Label>
</td>
<td style="width: 30px">&nbsp;</td>
<td class="captionCenter" colspan="4">
<asp:Label ID="Label18" runat="server" Text="講師查詢"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="Label10" runat="server" Text="地區"></asp:Label>
</td>
<td class="datainput" colspan="3">
<weblib:WDropDownList ID="ddl場地地區" runat="server" CssClass="inputFull">
</weblib:WDropDownList>
</td>
<td class="datainput">&nbsp;</td>
<td class="caption">
<asp:Label ID="Label19" runat="server" Text="地區"></asp:Label>
</td>
<td class="datainput" colspan="3">
<weblib:WDropDownList ID="ddl講師地區" runat="server" CssClass="inputFull">
</weblib:WDropDownList>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="Label11" runat="server" Text="價格"></asp:Label>
</td>
<td class="datainput">
<asp:TextBox ID="txt場地價格1" runat="server"></asp:TextBox>
</td>
<td class="datainput">
<asp:Label ID="Label15" runat="server" Text="至"></asp:Label>
</td>
<td class="datainput">
<asp:TextBox ID="txt場地價格2" runat="server"></asp:TextBox>
</td>
<td class="datainput">&nbsp;</td>
<td class="caption">
<asp:Label ID="Label21" runat="server" Text="專長"></asp:Label>
</td>
<td class="datainput" colspan="3">
<asp:TextBox ID="txt講師專長" runat="server" CssClass="inputFull"></asp:TextBox>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="Label12" runat="server" Text="容納人數"></asp:Label>
</td>
<td class="datainput">
<asp:TextBox ID="txt場地人數1" runat="server"></asp:TextBox>
</td>
<td class="datainput">
<asp:Label ID="Label16" runat="server" Text="至"></asp:Label>
</td>
<td class="datainput">
<asp:TextBox ID="txt場地人數2" runat="server"></asp:TextBox>
</td>
<td class="datainput">&nbsp;</td>
<td class="caption">
<asp:Label ID="Label22" runat="server" Text="學歷"></asp:Label>
</td>
<td class="datainput" colspan="3">
<asp:TextBox ID="txt講師學歷" runat="server" CssClass="inputFull"></asp:TextBox>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="Label13" runat="server" Text="教室類型"></asp:Label>
</td>
<td class="datainput" colspan="3">
<weblib:WDropDownList ID="ddl場地教室類型" runat="server" CssClass="inputFull">
</weblib:WDropDownList>
</td>
<td class="datainput">&nbsp;</td>
<td class="caption">
<asp:Label ID="Label20" runat="server" Text="滿意度"></asp:Label>
</td>
<td class="datainput">
<asp:TextBox ID="txt講師滿意度1" runat="server"></asp:TextBox>
</td>
<td class="datainput">
<asp:Label ID="Label23" runat="server" Text="至"></asp:Label>
</td>
<td class="datainput">
<asp:TextBox ID="txt講師滿意度2" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="Label14" runat="server" Text="滿意度"></asp:Label>
</td>
<td class="datainput">
<asp:TextBox ID="txt場地滿意度1" runat="server"></asp:TextBox>
</td>
<td class="datainput">
<asp:Label ID="Label17" runat="server" Text="至"></asp:Label>
</td>
<td class="datainput">
<asp:TextBox ID="txt場地滿意度2" runat="server"></asp:TextBox>
</td>
<td class="datainput">&nbsp;</td>
<td class="datainput" colspan="4">
<asp:LinkButton ID="btn查詢2" runat="server" CssClass="button blue80" OnClick="btn查詢2_Click">查詢</asp:LinkButton>
<asp:LinkButton ID="btn清除2" runat="server" CssClass="button orange80" OnClick="btn清除2_Click">清除</asp:LinkButton>
</td>
</tr>
<tr>
<td class="datainput" colspan="4">
<asp:LinkButton ID="btn查詢1" runat="server" CssClass="button blue80" OnClick="btn查詢1_Click">查詢</asp:LinkButton>
<asp:LinkButton ID="btn清除1" runat="server" CssClass="button orange80" OnClick="btn清除1_Click">清除</asp:LinkButton>
</td>
</tr>
</table>
<asp:Panel ID="pnl場地" runat="server">
<h3>場地查詢結果</h3>
<asp:GridView ID="gv場地" runat="server" AutoGenerateColumns="False" DataKeyNames="編號" DataSourceID="ds場地" EnableModelValidation="True" EnableViewState="False" OnDataBound="gv場地_DataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="button blue60" OnClientClick='<%# GetOpenWindowJS("PlaceDetail.aspx", "_placeDetail", "id", Eval("編號")) %>'>詳情</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="編號" HeaderText="編號" ReadOnly="True" SortExpression="編號" DataFormatString="{0:0000}" />
<asp:BoundField DataField="單位名稱" HeaderText="單位名稱" SortExpression="單位名稱" />
<asp:BoundField DataField="場地名稱" HeaderText="場地名稱" SortExpression="場地名稱" />
<asp:BoundField DataField="場地類型" HeaderText="場地類型" SortExpression="場地類型" />
<asp:BoundField DataField="價格" HeaderText="價格" SortExpression="價格" />
<asp:BoundField DataField="坪數" HeaderText="坪數" SortExpression="坪數" />
<asp:BoundField DataField="容納人數" HeaderText="容納人數" SortExpression="容納人數" />
<asp:TemplateField HeaderText="地址" SortExpression="地址_郵編">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("地址_郵編") %>'></asp:Label>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("地址_縣市") %>'></asp:Label>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("地址_鄉鎮市區") %>'></asp:Label>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("地址_街道地址") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="聯絡人" HeaderText="聯絡人" SortExpression="聯絡人" />
<asp:BoundField DataField="聯絡人電話" HeaderText="聯絡人電話" SortExpression="聯絡人電話" />
<asp:BoundField DataField="電子郵件" HeaderText="電子郵件" SortExpression="電子郵件" />
<asp:BoundField DataField="傳真" HeaderText="傳真" SortExpression="傳真" />
</Columns>
<EmptyDataTemplate>
<asp:Label ID="Label24" runat="server" CssClass="ErrorMessage" Text="查無符合條件的資料,請輸入其他查詢條件"></asp:Label>
</EmptyDataTemplate>
<PagerTemplate>
<weblib:GridViewPager ID="GridViewPager2" runat="server" />
</PagerTemplate>
</asp:GridView>
</asp:Panel>
<asp:Panel ID="pnl講師" runat="server">
<h3>講師查詢結果</h3>
<asp:GridView ID="gv講師" runat="server" AutoGenerateColumns="False" DataKeyNames="編號" DataSourceID="ds講師" EnableModelValidation="True" EnableViewState="False" OnDataBound="gv講師_DataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="button blue60" OnClientClick='<%# GetOpenWindowJS("TeacherDetail.aspx", "_teacherDetail", "id", Eval("編號")) %>'>詳情</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="編號" HeaderText="編號" ReadOnly="True" SortExpression="編號" DataFormatString="{0:0000}" />
<asp:BoundField DataField="姓名" HeaderText="姓名" SortExpression="姓名" />
<asp:BoundField DataField="電話" HeaderText="電話" SortExpression="電話" />
<asp:BoundField DataField="手機" HeaderText="手機" SortExpression="手機" />
<asp:BoundField DataField="電子郵件" HeaderText="電子郵件" SortExpression="電子郵件" />
<asp:TemplateField HeaderText="居住地址" SortExpression="居住地址_郵編">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("居住地址_郵編") %>'></asp:Label>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("居住地址_縣市") %>'></asp:Label>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("居住地址_鄉鎮市區") %>'></asp:Label>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("居住地址_街道地址") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="學歷" HeaderText="學歷" SortExpression="學歷" />
<asp:BoundField DataField="授課區域" HeaderText="授課區域" SortExpression="授課區域" />
<asp:BoundField DataField="授課專長領域" HeaderText="授課專長領域" SortExpression="授課專長領域" />
</Columns>
<EmptyDataTemplate>
<asp:Label ID="Label24" runat="server" CssClass="ErrorMessage" Text="查無符合條件的資料,請輸入其他查詢條件"></asp:Label>
</EmptyDataTemplate>
<PagerTemplate>
<weblib:GridViewPager ID="GridViewPager1" runat="server" />
</PagerTemplate>
</asp:GridView>
</asp:Panel>
</asp:Content>
@@ -0,0 +1,82 @@
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.
{
public partial class : FormBase
{
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "查詢作業";
if (!IsPostBack)
{
ddl場地地區.DataSource = Dao場地.Select地區ForDropDown();
ddl場地地區.DataTextField = "Name";
ddl場地地區.DataValueField = "Value";
ddl場地地區.DataBind();
ddl講師地區.DataSource = Dao講師.Select地區ForDropDown();
ddl講師地區.DataTextField = "Name";
ddl講師地區.DataValueField = "Value";
ddl講師地區.DataBind();
ddl場地教室類型.DataSource = Dao場地.Select教室類型ForDropDown();
ddl場地教室類型.DataTextField = "Name";
ddl場地教室類型.DataValueField = "Value";
ddl場地教室類型.DataBind();
}
else
{
gv場地.DataBind();
gv講師.DataBind();
}
}
protected void btn查詢1_Click(object sender, EventArgs e)
{
}
protected void btn清除1_Click(object sender, EventArgs e)
{
ddl場地地區.SelectedValue = "";
txt場地價格1.Text = "";
txt場地價格2.Text = "";
txt場地人數1.Text = "";
txt場地人數2.Text = "";
ddl場地教室類型.SelectedValue = "";
txt場地滿意度1.Text = "";
txt場地滿意度2.Text = "";
}
protected void btn查詢2_Click(object sender, EventArgs e)
{
}
protected void btn清除2_Click(object sender, EventArgs e)
{
ddl講師地區.SelectedValue = "";
txt講師專長.Text = "";
txt講師學歷.Text = "";
txt講師滿意度1.Text = "";
txt講師滿意度2.Text = "";
}
protected void gv場地_DataBound(object sender, EventArgs e)
{
pnl場地.Visible = gv場地.Rows.Count > 0;
}
protected void gv講師_DataBound(object sender, EventArgs e)
{
pnl講師.Visible = gv講師.Rows.Count > 0;
}
}
}
@@ -0,0 +1,359 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class
{
/// <summary>
/// ds場地 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds場地;
/// <summary>
/// ds講師 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds講師;
/// <summary>
/// Label9 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label9;
/// <summary>
/// Label18 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label18;
/// <summary>
/// Label10 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label10;
/// <summary>
/// ddl場地地區 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.WDropDownList ddl場地地區;
/// <summary>
/// Label19 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label19;
/// <summary>
/// ddl講師地區 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.WDropDownList ddl講師地區;
/// <summary>
/// Label11 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label11;
/// <summary>
/// txt場地價格1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt場地價格1;
/// <summary>
/// Label15 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label15;
/// <summary>
/// txt場地價格2 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt場地價格2;
/// <summary>
/// Label21 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label21;
/// <summary>
/// txt講師專長 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt講師專長;
/// <summary>
/// Label12 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label12;
/// <summary>
/// txt場地人數1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt場地人數1;
/// <summary>
/// Label16 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label16;
/// <summary>
/// txt場地人數2 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt場地人數2;
/// <summary>
/// Label22 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label22;
/// <summary>
/// txt講師學歷 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt講師學歷;
/// <summary>
/// Label13 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label13;
/// <summary>
/// ddl場地教室類型 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.WDropDownList ddl場地教室類型;
/// <summary>
/// Label20 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label20;
/// <summary>
/// txt講師滿意度1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt講師滿意度1;
/// <summary>
/// Label23 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label23;
/// <summary>
/// txt講師滿意度2 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt講師滿意度2;
/// <summary>
/// Label14 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label14;
/// <summary>
/// txt場地滿意度1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt場地滿意度1;
/// <summary>
/// Label17 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label17;
/// <summary>
/// txt場地滿意度2 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt場地滿意度2;
/// <summary>
/// btn查詢2 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btn查詢2;
/// <summary>
/// btn清除2 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btn清除2;
/// <summary>
/// btn查詢1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btn查詢1;
/// <summary>
/// btn清除1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btn清除1;
/// <summary>
/// pnl場地 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Panel pnl場地;
/// <summary>
/// gv場地 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gv場地;
/// <summary>
/// pnl講師 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Panel pnl講師;
/// <summary>
/// gv講師 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gv講師;
}
}
@@ -0,0 +1,319 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true" CodeBehind="片語管理.aspx.cs" Inherits="Education.Forms.基本資料.片語管理" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
<%@ Import Namespace="System.Collections.Generic" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ObjectDataSource ID="ds片語Form" runat="server" DataObjectTypeName="Education.片語Item"
TypeName="Education.DAC_片語" OldValuesParameterFormatString="original_{0}"
SelectMethod="SelectOne" InsertMethod="InsertOne" UpdateMethod="UpdateOne" DeleteMethod="DeleteOne">
<SelectParameters>
<asp:ControlParameter ControlID="gv片語" Name="編號"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ds片語Grid" runat="server" DataObjectTypeName="Education.片語Item"
TypeName="Education.DAC_片語" OldValuesParameterFormatString="original_{0}"
EnablePaging="true" SelectMethod="SelectPage" SelectCountMethod="SelectCount">
<SelectParameters>
<asp:Parameter Name="noInputReturnAll" Type="Boolean" DefaultValue="true" />
<asp:Parameter Name="orderBy" Type="String" DefaultValue="" />
<asp:ControlParameter Name="適用欄位" Type="String" ControlID="ddl適用欄位_Search" PropertyName="SelectedValue"></asp:ControlParameter>
<asp:ControlParameter Name="片語內容" Type="String" ControlID="txt片語內容_Search" PropertyName="Text"></asp:ControlParameter>
</SelectParameters>
</asp:ObjectDataSource>
<asp:LinkButton ID="tab處理" runat="server" CssClass="tabbuttonselected">片語設定</asp:LinkButton>
<asp:LinkButton ID="tab查詢" runat="server" CssClass="tabbutton">查詢</asp:LinkButton>
<div style="border-top: 1px solid gray;">
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View處理" runat="server">
<asp:FormView ID="fv片語" runat="server" EnableModelValidation="True" EnableViewState="False"
DataKeyNames="編號,DB_APPNO" DataSourceID="ds片語Form">
<ItemTemplate>
<div>
<asp:LinkButton ID="btnInsert" runat="server" Text="新增" CommandName="New" CssClass="button blue80" />
<asp:LinkButton ID="btnUpdate" runat="server" Text="更正" CommandName="Edit" CssClass="button green80" />
<asp:LinkButton ID="btnDelete" runat="server" Text="刪除" CommandName="Delete" CssClass="button red80" OnClientClick="return confirm(&quot;是否確定刪除此筆資料?&quot;);" />
</div>
<table border="0" cellpadding="3" cellspacing="2" style="table-layout: fixed;">
<tr>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
</tr>
<%-- <tr>
<td class="caption">
<asp:Label ID="lb編號Label" runat="server" Text="編號"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb編號" runat="server" Text='<%# Bind("編號") %>' CssClass="inputFull"></asp:Label>
</td>
</tr>--%>
<tr>
<td class="caption">
<asp:Label ID="lb適用欄位Label" runat="server" Text="適用欄位"></asp:Label>
</td>
<td class="datadisplay" colspan="7">
<asp:Label ID="lb適用欄位" runat="server" Text='<%# Bind("適用欄位") %>' CssClass="inputFull"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb片語內容Label" runat="server" Text="片語內容"></asp:Label>
</td>
<td class="datadisplay" colspan="7">
<asp:Label ID="lb片語內容" runat="server" Text='<%# Bind("片語內容") %>' CssClass="inputFull"></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
<InsertItemTemplate>
<div>
<asp:LinkButton ID="btnSave" runat="server" Text="存檔" CommandName="Insert" CssClass="button blue80" />
<asp:LinkButton ID="btnCancel" runat="server" Text="取消" CommandName="Cancel" CausesValidation="false" CssClass="button red80" OnClientClick="return confirm(&quot;是否確定取消新增?&quot;);" />
</div>
<table border="0" cellpadding="3" cellspacing="2" style="table-layout: fixed;">
<tr>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
</tr>
<%-- <tr>
<td class="caption">
<asp:Label ID="lb編號Label" runat="server" Text="編號"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb編號" runat="server" Text="(自動編號)" CssClass="inputFull"></asp:Label>
</td>
</tr>--%>
<tr>
<td class="caption">
<asp:Label ID="lb適用欄位Label" runat="server" Text="適用欄位"></asp:Label>
</td>
<td class="datainput" colspan="7">
<asp:ObjectDataSource ID="ds適用欄位" runat="server"
DataObjectTypeName="WebLib.NameValueItem"
TypeName="Education.DAC_片語"
SelectMethod="Options">
</asp:ObjectDataSource>
<asp:CheckBoxList ID="cbl適用欄位" runat="server"
RepeatLayout="Table"
RepeatDirection="Horizontal"
CellSpacing="3"
RepeatColumns="6"
DataSourceID="ds適用欄位"
DataTextField="Name" DataValueField="Value">
</asp:CheckBoxList>
</td>
</tr>
<tr>
<td class="caption">
<span style="color: red;"></span><asp:Label ID="lb片語內容Label" runat="server" Text="片語內容"></asp:Label>
</td>
<td class="datainput" colspan="7">
<asp:TextBox ID="txt片語內容" runat="server" Text='<%# Bind("片語內容") %>' MaxLength="100" CssClass="inputFull"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfv片語內容" runat="server" ControlToValidate="txt片語內容" Display="Dynamic" ErrorMessage="請輸入"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</InsertItemTemplate>
<EditItemTemplate>
<div>
<asp:LinkButton ID="btnSave" runat="server" Text="存檔" CommandName="Update" CssClass="button blue80" />
<asp:LinkButton ID="btnCancel" runat="server" Text="取消" CommandName="Cancel" CausesValidation="false" CssClass="button red80" OnClientClick="return confirm(&quot;是否確定取消更正?&quot;);" />
<asp:HiddenField ID="hfDBAPPNO" runat="server" Value='<%# Bind("DB_APPNO") %>' />
</div>
<table border="0" cellpadding="3" cellspacing="2" style="table-layout: fixed;">
<tr>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
</tr>
<%-- <tr>
<td class="caption">
<asp:Label ID="lb編號Label" runat="server" Text="編號"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb編號" runat="server" Text='<%# Bind("編號") %>' CssClass="inputFull"></asp:Label>
</td>
</tr>--%>
<tr>
<td class="caption">
<asp:Label ID="lb適用欄位Label" runat="server" Text="適用欄位"></asp:Label>
</td>
<td class="datainput" colspan="7">
<asp:ObjectDataSource ID="ds適用欄位" runat="server"
DataObjectTypeName="WebLib.NameValueItem"
TypeName="Education.DAC_片語"
SelectMethod="Options">
</asp:ObjectDataSource>
<asp:CheckBoxList ID="cbl適用欄位" runat="server"
RepeatLayout="Table"
RepeatDirection="Horizontal"
CellSpacing="3"
RepeatColumns="6"
DataSourceID="ds適用欄位"
DataTextField="Name" DataValueField="Value">
</asp:CheckBoxList>
</td>
</tr>
<tr>
<td class="caption">
<span style="color: red;"></span><asp:Label ID="lb片語內容Label" runat="server" Text="片語內容"></asp:Label>
</td>
<td class="datainput" colspan="7">
<asp:TextBox ID="txt片語內容" runat="server" Text='<%# Bind("片語內容") %>' MaxLength="100" CssClass="inputFull"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfv片語內容" runat="server" ControlToValidate="txt片語內容" Display="Dynamic" ErrorMessage="請輸入"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</EditItemTemplate>
<EmptyDataTemplate>
<div>
<asp:LinkButton ID="btnInsert" runat="server" Text="新增" CommandName="New" CssClass="button blue80" />
</div>
<table border="0" cellpadding="3" cellspacing="2" style="table-layout: fixed;">
<tr>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
</tr>
<%-- <tr>
<td class="caption">
<asp:Label ID="lb編號Label" runat="server" Text="編號"></asp:Label>
</td>
<td class="datadisplay" colspan="1"></td>
</tr>--%>
<tr>
<td class="caption" colspan="1">
<asp:Label ID="lb適用欄位Label" runat="server" Text="適用欄位"></asp:Label>
</td>
<td class="datadisplay" colspan="7"></td>
</tr>
<tr>
<td class="caption" colspan="1">
<asp:Label ID="lb片語內容Label" runat="server" Text="片語內容"></asp:Label>
</td>
<td class="datadisplay" colspan="7"></td>
</tr>
</table>
</EmptyDataTemplate>
</asp:FormView>
<asp:GridView ID="gv片語" runat="server" DataKeyNames="編號"
AllowPaging="True" AutoGenerateColumns="False" EnableModelValidation="True"
EnableViewState="True"
DataSourceID="ds片語Grid">
<Columns>
<%-- <asp:TemplateField HeaderText="編號" SortExpression="編號">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server"
Text='<%# Eval("編號", "{0}") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server"
Text='<%# Bind("編號", "{0}") %>'></asp:Label>
<asp:LinkButton ID="LinkButton1" runat="server"
CausesValidation="False" CommandName="Select" Text=""></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="4em" />
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="適用欄位" SortExpression="適用欄位">
<ItemTemplate>
<asp:Label ID="Label1" runat="server"
Text='<%# Bind("適用欄位", "{0}") %>'></asp:Label>
<asp:LinkButton ID="LinkButton1" runat="server"
CausesValidation="False" CommandName="Select" Text=""></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="30em" />
</asp:TemplateField>
<asp:BoundField DataField="片語內容" HeaderText="片語內容" SortExpression="片語內容">
<ItemStyle Width="30em" />
</asp:BoundField>
</Columns>
<PagerTemplate>
<weblib:GridViewPager ID="GridViewPager1" runat="server" />
</PagerTemplate>
</asp:GridView>
</asp:View>
<asp:View ID="View查詢" runat="server">
<div>
<asp:LinkButton ID="btnSearch" runat="server"
CssClass="button blue80" Text="查詢"
OnClick="btnSearch_Click" />
<asp:LinkButton ID="btnClear" runat="server"
CssClass="button red80" Text="清除"
OnClick="btnClear_Click" />
</div>
<table border="0" cellpadding="3" cellspacing="2" style="table-layout: fixed;">
<tr>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
<td colspan="1" class="widthcontrol" style="width: 40px;"></td>
<td colspan="1" class="widthcontrol" style="width: 120px;"></td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb適用欄位Label" runat="server" Text="適用欄位"></asp:Label>
</td>
<td class="datainput" colspan="3">
<asp:ObjectDataSource ID="ds適用欄位" runat="server"
DataObjectTypeName="WebLib.NameValueItem"
TypeName="Education.DAC_片語"
SelectMethod="OptionsForSearch">
</asp:ObjectDataSource>
<asp:DropDownList ID="ddl適用欄位_Search" runat="server"
DataSourceID="ds適用欄位" DataTextField="Name" DataValueField="Value">
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb片語內容Label" runat="server" Text="片語內容"></asp:Label>
</td>
<td class="datainput" colspan="3">
<asp:TextBox ID="txt片語內容_Search" runat="server" Text="" MaxLength="100" CssClass="inputFull"></asp:TextBox>
</td>
</tr>
</table>
<asp:Label ID="lbMessage" runat="server"
CssClass="ErrorMessage"
EnableViewState="False"></asp:Label>
</asp:View>
</asp:MultiView>
</div>
</asp:Content>
@@ -0,0 +1,118 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Education.Forms.
{
public partial class : FormBase
{
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "片語管理";
Form_View = fv片語;
Grid_View = gv片語;
FormView_DataSource = ds片語Form;
GridView_DataSource = ds片語Grid;
AddTabButton(MultiView1, 0, tab處理);
AddTabButton(MultiView1, 1, tab查詢);
if (!IsPostBack)
{
ActivateTab(MultiView1, 0);
}
else
{
Grid_View.DataBind();
Form_View.DataBind();
}
if (Form_View.CurrentMode != FormViewMode.ReadOnly)
{
Grid_View.Visible = false;
}
}
protected void btnSearch_Click(object sender, EventArgs e)
{
Grid_View.PageIndex = 0;
Grid_View.DataBind();
}
protected void btnClear_Click(object sender, EventArgs e)
{
ddl適用欄位_Search.SelectedValue = "";
txt片語內容_Search.Text = "";
}
protected override void GridView_DataSource_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
base.GridView_DataSource_Selected(sender, e);
if (MultiView1.ActiveViewIndex == 1)
{
if (e.ReturnValue is List list && list.Count > 0)
ActivateTab(MultiView1, 0);
else
lbMessage.Text = "找不到合乎條件的資料";
}
}
protected void dsForm_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao片語;
}
protected void dsGrid_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao片語;
}
protected string Get適用欄位Value()
{
var Items = FindControl<CheckBoxList>(Form_View, "cbl適用欄位").Items;
var Value = new List<string>();
for (var i = 0; i < Items.Count; i++)
{
var item = Items[i];
if (item.Selected)
Value.Add(item.Value);
}
return string.Join(",", Value.ToArray());
}
protected override void FormView_ItemInserting(object sender, FormViewInsertEventArgs e)
{
base.FormView_ItemInserting(sender, e);
if (e.Values.Contains("適用欄位"))
e.Values["適用欄位"] = Get適用欄位Value();
else
e.Values.Add("適用欄位", Get適用欄位Value());
}
protected override void FormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
base.FormView_ItemUpdating(sender, e);
if (e.NewValues.Contains("適用欄位"))
e.NewValues["適用欄位"] = Get適用欄位Value();
else
e.NewValues.Add("適用欄位", Get適用欄位Value());
}
protected override void FormView_EditDataBound(object sender, EventArgs e)
{
base.FormView_EditDataBound(sender, e);
CheckBoxList cbl適用欄位 = FindControl<CheckBoxList>(Form_View, "cbl適用欄位");
foreach (ListItem item in cbl適用欄位.Items)
{
item.Selected = (Form_View.DataItem as Item)..IndexOf(item.Value) >= 0;
}
}
}
}
@@ -0,0 +1,170 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class
{
/// <summary>
/// ds片語Form 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds片語Form;
/// <summary>
/// ds片語Grid 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds片語Grid;
/// <summary>
/// tab處理 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton tab處理;
/// <summary>
/// tab查詢 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton tab查詢;
/// <summary>
/// MultiView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.MultiView MultiView1;
/// <summary>
/// View處理 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.View View處理;
/// <summary>
/// fv片語 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.FormView fv片語;
/// <summary>
/// gv片語 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gv片語;
/// <summary>
/// View查詢 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.View View查詢;
/// <summary>
/// btnSearch 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnSearch;
/// <summary>
/// btnClear 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnClear;
/// <summary>
/// lb適用欄位Label 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb適用欄位Label;
/// <summary>
/// ds適用欄位 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds適用欄位;
/// <summary>
/// ddl適用欄位_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddl適用欄位_Search;
/// <summary>
/// lb片語內容Label 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb片語內容Label;
/// <summary>
/// txt片語內容_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt片語內容_Search;
/// <summary>
/// lbMessage 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbMessage;
}
}
@@ -0,0 +1,507 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master"
AutoEventWireup="true" CodeBehind="課程基本資料.aspx.cs" Inherits="Education.Forms.基本資料.課程基本資料" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
runat="server">
<asp:LinkButton ID="tab處理" runat="server" CssClass="tabbuttonselected">處理</asp:LinkButton>
<asp:LinkButton ID="tab查詢" runat="server" CssClass="tabbutton">查詢</asp:LinkButton>
<div style="border-top: 1px solid gray;">
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View查詢" runat="server">
<div>
<asp:LinkButton ID="btnSearch" runat="server"
CssClass="button blue80" Text="查詢"
OnClick="btnSearch_Click" />
<asp:LinkButton ID="btnClear" runat="server"
CssClass="button red80" Text="清除"
OnClick="btnClear_Click" />
</div>
<table border="0"
style="table-layout: fixed;">
<tr>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 150px;"></td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程類別Label3" runat="server" Text="課程類別"></asp:Label>
</td>
<td class="datainput" colspan="1">
<weblib:WDropDownList ID="ddl課程類別_Search" runat="server"
CssClass="inputFull" DataSourceID="dsBCLS"
DataTextField="Name" DataValueField="Value">
</weblib:WDropDownList>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程編號Label3" runat="server" Text="課程編號"></asp:Label>
</td>
<td class="datainput" colspan="1">
<asp:TextBox ID="txt課程編號_Search" runat="server"
CssClass="inputFull" MaxLength="50" Text=""></asp:TextBox>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程名稱Label3" runat="server" Text="課程名稱"></asp:Label>
</td>
<td class="datainput" colspan="5">
<asp:TextBox ID="txt課程名稱_Search" runat="server"
CssClass="inputFull" MaxLength="100" Text=""></asp:TextBox>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb訓練對象Label3" runat="server" Text="訓練對象"></asp:Label>
</td>
<td class="datainput" colspan="1">
<asp:TextBox ID="txt訓練對象_Search" runat="server"
CssClass="inputFull" MaxLength="50" Text=""></asp:TextBox>
</td>
</tr>
</table>
<asp:Label ID="lbMessage" runat="server"
CssClass="ErrorMessage"
EnableViewState="False"></asp:Label>
</asp:View>
<asp:View ID="View處理" runat="server">
<asp:ObjectDataSource ID="dsForm" runat="server"
DataObjectTypeName="Education.課程" DeleteMethod="DeleteOne"
InsertMethod="InsertOne"
OldValuesParameterFormatString="original_{0}"
SelectMethod="SelectOne" TypeName="Education.DAC_課程"
UpdateMethod="UpdateOne"
OnObjectCreating="dsForm_ObjectCreating">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="課程編號"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="dsGrid" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="Select" TypeName="Education.DAC_課程"
OnObjectCreating="dsGrid_ObjectCreating">
<SelectParameters>
<asp:Parameter DefaultValue="true" Name="noInputReturnAll"
Type="Boolean" />
<asp:ControlParameter ControlID="txt課程編號_Search"
Name="課程編號" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="ddl課程類別_Search"
Name="課程類別" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="txt課程名稱_Search"
Name="課程名稱" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txt訓練對象_Search"
Name="訓練對象" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="dsBCLS" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="Get類別資料By大類ForDropDown"
TypeName="Education.DAC_BCLS"
OnObjectCreating="dsBCLS_ObjectCreating">
<SelectParameters>
<asp:Parameter DefaultValue="課程類別" Name="大類"
Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="dsBCLS0" runat="server"
OldValuesParameterFormatString="original_{0}"
OnObjectCreating="dsBCLS_ObjectCreating" SelectMethod="Get類別資料By大類ForDropDown"
TypeName="Education.DAC_BCLS">
<SelectParameters>
<asp:Parameter DefaultValue="課程類型" Name="大類" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:FormView ID="FormView1" runat="server" EnableModelValidation="True"
EnableViewState="False" DataKeyNames="課程編號,課程類別,DB_APPNO"
DataSourceID="dsForm">
<ItemTemplate>
<div>
<asp:LinkButton ID="btnInsert" runat="server" Text="新增" CommandName="New"
CssClass="button blue80" />
<asp:LinkButton ID="btnUpdate" runat="server" Text="更正" CommandName="Edit"
CssClass="button green80" />
<asp:LinkButton ID="btnDelete" runat="server" Text="刪除" CommandName="Delete"
CssClass="button red80" OnClientClick="return confirm(&quot;是否確定刪除此筆資料?&quot;);" />
</div>
<table border="0" class="fixedwithoutborder">
<tr>
<td colspan="1" class="widthcontrol" style="width: 80px;"></td>
<td colspan="1" class="widthcontrol" style="width: 200px;"></td>
<td colspan="1" class="widthcontrol" style="width: 80px;"></td>
<td colspan="1" class="widthcontrol" style="width: 200px;"></td>
<td class="widthcontrol" style="width: 80px;"></td>
<td class="widthcontrol" style="width: 200px;"></td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程編號Label" runat="server" Text="課程編號"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb課程編號" runat="server" CssClass="inputFull"
Text='<%# Bind("課程編號") %>'></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb課程類別Label" runat="server" Text="課程類別"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb課程類別" runat="server" CssClass="inputFull"
Text='<%# Eval("課程類別") %>'></asp:Label>
<asp:Label ID="lb課程類別0" runat="server" CssClass="inputFull"
Text='<%# Get類別名稱("課程類別", Eval("課程類別")) %>'></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb課程類型Label" runat="server" Text="課程類型"></asp:Label>
</td>
<td class="datadisplay">
<asp:Label ID="lb課程類型" runat="server" CssClass="inputFull"
Text='<%# Get類別名稱("課程類型",Eval("課程類型")) %>'></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程名稱Label" runat="server" Text="課程名稱"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Label ID="lb課程名稱" runat="server" Text='<%# Bind("課程名稱") %>'
CssClass="inputFull"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb訓練對象Label" runat="server" Text="訓練對象"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb訓練對象" runat="server" Text='<%# Bind("訓練對象") %>'
CssClass="inputFull"></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb課程時數Label" runat="server" Text="課程時數"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb課程時數" runat="server" Text='<%# Bind("課程時數") %>'
CssClass="inputFull"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程內容Label" runat="server" Text="課程內容"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Label ID="lb課程內容" runat="server" Text='<%# Eval("課程內容", "{0}").Replace("\r", "<br/>") %>'
CssClass="inputFull"></asp:Label>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb備註Label" runat="server" Text="備註"></asp:Label>
</td>
<td class="datadisplay" colspan="5">
<asp:Label ID="lb備註" runat="server" Text='<%# Eval("備註", "{0}").Replace("\r", "<br/>") %>'
CssClass="inputFull"></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
<InsertItemTemplate>
<div>
<asp:LinkButton ID="btnSave" runat="server" Text="存檔" CommandName="Insert"
CssClass="button blue80" />
<asp:LinkButton ID="btnCancel" runat="server" Text="取消" CommandName="Cancel"
CausesValidation="false" CssClass="button red80" OnClientClick="return confirm(&quot;是否確定取消新增?&quot;);" />
</div>
<table border="0"
style="table-layout: fixed;">
<tr>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 200px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 200px;"></td>
<td class="widthcontrol" style="width: 90px;">&nbsp;</td>
<td class="widthcontrol" style="width: 200px;">&nbsp;</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程編號Label" runat="server" Text="課程編號"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="Label9" runat="server" Text="(自動編號)"></asp:Label>
</td>
<td class="caption">
<span style="color: red;"></span><asp:Label ID="lb課程類別Label" runat="server"
Text="課程類別"></asp:Label>
</td>
<td class="datainput" colspan="1">
<weblib:WDropDownList ID="ddl課程類別" runat="server" CssClass="inputFull"
DataSourceID="dsBCLS" DataTextField="Name" DataValueField="Value"
SelectedValue='<%# Bind("課程類別") %>'>
</weblib:WDropDownList>
<asp:RequiredFieldValidator ID="rfv課程類別" runat="server"
ControlToValidate="ddl課程類別" Display="Dynamic" ErrorMessage="請選擇"></asp:RequiredFieldValidator>
</td>
<td class="caption">
<span style="color: red;"></span><asp:Label ID="lb課程類型Label" runat="server" Text="課程類型"></asp:Label>
</td>
<td class="datainput">
<weblib:WDropDownList ID="dd課程類型" runat="server" CssClass="inputFull"
DataSourceID="dsBCLS0" DataTextField="Name" DataValueField="Value"
SelectedValue='<%# Bind("課程類型") %>'>
</weblib:WDropDownList>
<asp:RequiredFieldValidator ID="rfv課程類型" runat="server"
ControlToValidate="dd課程類型" Display="Dynamic" ErrorMessage="請輸入"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="caption">
<span style="color: red;"></span><asp:Label ID="lb課程名稱Label"
runat="server" Text="課程名稱"></asp:Label>
</td>
<td class="datainput" colspan="5">
<asp:TextBox ID="txt課程名稱" runat="server" Text='<%# Bind("課程名稱") %>'
MaxLength="100" CssClass="inputFull"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfv課程名稱" runat="server" ControlToValidate="txt課程名稱"
Display="Dynamic" ErrorMessage="請輸入"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb訓練對象Label" runat="server" Text="訓練對象"></asp:Label>
</td>
<td class="datainput" colspan="1">
<asp:TextBox ID="txt訓練對象" runat="server" Text='<%# Bind("訓練對象") %>'
MaxLength="50" CssClass="inputFull"></asp:TextBox>
</td>
<td class="caption">
<asp:Label ID="lb課程時數Label" runat="server" Text="課程時數"></asp:Label>
</td>
<td class="datainput" colspan="1">
<asp:TextBox ID="txt課程時數" runat="server" Text='<%# Bind("課程時數") %>'
MaxLength="20" CssClass="inputFull"></asp:TextBox>
<asp:RangeValidator ID="rv課程時數" runat="server"
ControlToValidate="txt課程時數" Display="Dynamic"
ErrorMessage="請輸入 1 至 100 的數字" MaximumValue="100"
MinimumValue="1" Type="Integer"></asp:RangeValidator>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程內容Label" runat="server" Text="課程內容"></asp:Label>
</td>
<td class="datainput" colspan="5">
<asp:TextBox ID="txt課程內容" runat="server" Text='<%# Bind("課程內容") %>'
MaxLength="2000" TextMode="MultiLine" Rows="5" CssClass="inputFull"></asp:TextBox>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb備註Label" runat="server" Text="備註"></asp:Label>
</td>
<td class="datainput" colspan="5">
<asp:TextBox ID="txt備註" runat="server" Text='<%# Bind("備註") %>'
MaxLength="1000" TextMode="MultiLine" Rows="5" CssClass="inputFull"></asp:TextBox>
</td>
</tr>
</table>
</InsertItemTemplate>
<EditItemTemplate>
<div>
<asp:LinkButton ID="btnSave" runat="server" Text="存檔" CommandName="Update"
CssClass="button blue80" />
<asp:LinkButton ID="btnCancel" runat="server" Text="取消" CommandName="Cancel"
CausesValidation="false" CssClass="button red80" OnClientClick="return confirm(&quot;是否確定取消更正?&quot;);" />
</div>
<table border="0" class="fixedwithoutborder">
<tr>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 200px;"></td>
<td colspan="1" class="widthcontrol" style="width: 90px;"></td>
<td colspan="1" class="widthcontrol" style="width: 200px;"></td>
<td class="widthcontrol" style="width: 90px;">&nbsp;</td>
<td class="widthcontrol" style="width: 200px;">&nbsp;</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程編號Label" runat="server" Text="課程編號"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb課程編號" runat="server" CssClass="inputFull"
Text='<%# Bind("課程編號") %>'></asp:Label>
</td>
<td class="caption">
<asp:Label ID="lb課程類別Label" runat="server" Text="課程類別"></asp:Label>
</td>
<td class="datadisplay" colspan="1">
<asp:Label ID="lb課程類別" runat="server" CssClass="inputFull"
Text='<%# Get類別名稱("課程類別", Eval("課程類別")) %>'></asp:Label>
</td>
<td class="caption">
<span style="color: red;"></span><asp:Label ID="lb課程類型Label" runat="server" Text="課程類型"></asp:Label>
</td>
<td class="datainput">
<weblib:WDropDownList ID="dd課程類型" runat="server" CssClass="inputFull"
DataSourceID="dsBCLS0" DataTextField="Name" DataValueField="Value"
SelectedValue='<%# Bind("課程類型") %>'>
</weblib:WDropDownList>
<asp:RequiredFieldValidator ID="rfv課程類型" runat="server"
ControlToValidate="dd課程類型" Display="Dynamic" ErrorMessage="請輸入"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="caption">
<span style="color: red;"></span><asp:Label ID="lb課程名稱Label"
runat="server" Text="課程名稱"></asp:Label>
</td>
<td class="datainput" colspan="5">
<asp:TextBox ID="txt課程名稱" runat="server" Text='<%# Bind("課程名稱") %>'
MaxLength="100" CssClass="inputFull"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfv課程名稱" runat="server" ControlToValidate="txt課程名稱"
Display="Dynamic" ErrorMessage="請輸入"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb訓練對象Label" runat="server" Text="訓練對象"></asp:Label>
</td>
<td class="datainput" colspan="1">
<asp:TextBox ID="txt訓練對象" runat="server" Text='<%# Bind("訓練對象") %>'
MaxLength="50" CssClass="inputFull"></asp:TextBox>
</td>
<td class="caption">
<asp:Label ID="lb課程時數Label" runat="server" Text="課程時數"></asp:Label>
</td>
<td class="datainput" colspan="1">
<asp:TextBox ID="txt課程時數" runat="server" Text='<%# Bind("課程時數") %>'
MaxLength="20" CssClass="inputFull"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfv課程時數" runat="server" ControlToValidate="txt課程時數"
Display="Dynamic" ErrorMessage="請輸入"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="rev課程時數" runat="server" ControlToValidate="txt課程時數"
ValidationExpression="\d{1,20}" Display="Dynamic" ErrorMessage="請輸入數字"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程內容Label" runat="server" Text="課程內容"></asp:Label>
</td>
<td class="datainput" colspan="5">
<asp:TextBox ID="txt課程內容" runat="server" Text='<%# Bind("課程內容") %>'
MaxLength="2000" TextMode="MultiLine" Rows="5" CssClass="inputFull"></asp:TextBox>
</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb備註Label" runat="server" Text="備註"></asp:Label>
</td>
<td class="datainput" colspan="5">
<asp:TextBox ID="txt備註" runat="server" Text='<%# Bind("備註") %>'
MaxLength="1000" TextMode="MultiLine" Rows="5" CssClass="inputFull"></asp:TextBox>
</td>
</tr>
</table>
</EditItemTemplate>
<EmptyDataTemplate>
<div>
<asp:LinkButton ID="btnInsert" runat="server" Text="新增" CommandName="New"
CssClass="button blue80" />
</div>
<table border="0" style="table-layout: fixed;">
<tr>
<td colspan="1" class="widthcontrol" style="width: 80px;"></td>
<td colspan="1" class="widthcontrol" style="width: 200px;"></td>
<td colspan="1" class="widthcontrol" style="width: 80px;"></td>
<td colspan="1" class="widthcontrol" style="width: 200px;"></td>
<td class="widthcontrol" style="width: 80px;">&nbsp;</td>
<td class="widthcontrol" style="width: 200px;">&nbsp;</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程類別Label" runat="server" Text="課程類別"></asp:Label>
</td>
<td class="datadisplay" colspan="1"></td>
<td class="caption">
<asp:Label ID="lb課程編號Label" runat="server" Text="課程編號"></asp:Label>
</td>
<td class="datadisplay" colspan="1"></td>
<td class="caption">
<asp:Label ID="lb課程類型Label" runat="server" Text="課程類型"></asp:Label>
</td>
<td class="datadisplay">&nbsp;</td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程名稱Label" runat="server" Text="課程名稱"></asp:Label>
</td>
<td class="datadisplay" colspan="5"></td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb訓練對象Label" runat="server" Text="訓練對象"></asp:Label>
</td>
<td class="datadisplay" colspan="1"></td>
<td class="caption">
<asp:Label ID="lb課程時數Label" runat="server" Text="課程時數"></asp:Label>
</td>
<td class="datadisplay" colspan="1"></td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb課程內容Label" runat="server" Text="課程內容"></asp:Label>
</td>
<td class="datadisplay" colspan="5"></td>
</tr>
<tr>
<td class="caption">
<asp:Label ID="lb備註Label" runat="server" Text="備註"></asp:Label>
</td>
<td class="datadisplay" colspan="5"></td>
</tr>
</table>
</EmptyDataTemplate>
</asp:FormView>
<asp:GridView ID="GridView1" runat="server"
AllowPaging="True" AutoGenerateColumns="False"
DataKeyNames="課程編號" DataSourceID="dsGrid"
EnableModelValidation="True" Width="100%">
<Columns>
<asp:TemplateField HeaderText="課程編號" SortExpression="課程編號">
<ItemTemplate>
<asp:Label ID="Label1" runat="server"
Text='<%# Bind("課程編號") %>'></asp:Label>
<asp:LinkButton ID="LinkButton1" runat="server"
CausesValidation="False" CommandName="Select"></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="課程類別" SortExpression="課程類別">
<ItemTemplate>
<asp:Label ID="lb課程類別" runat="server" CssClass="inputFull"
Text='<%# Get類別名稱("課程類別", Eval("課程類別")) %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="課程類型" SortExpression="課程類型">
<ItemTemplate>
<asp:Label ID="lb課程類型" runat="server" CssClass="inputFull"
Text='<%# Get類別名稱("課程類型",Eval("課程類型")) %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="課程名稱" HeaderText="課程名稱"
SortExpression="課程名稱" />
<asp:BoundField DataField="訓練對象" HeaderText="訓練對象"
SortExpression="訓練對象" />
<asp:BoundField DataField="課程時數" HeaderText="課程時數"
SortExpression="課程時數" />
</Columns>
<PagerTemplate>
<weblib:GridViewPager ID="GridViewPager1" runat="server" />
</PagerTemplate>
</asp:GridView>
</asp:View>
</asp:MultiView>
</div>
</asp:Content>
@@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebLib;
namespace Education.Forms.
{
public partial class : FormBase
{
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "課程基本資料";
Form_View = FormView1;
Grid_View = GridView1;
FormView_DataSource = dsForm;
GridView_DataSource = dsGrid;
AddTabButton(MultiView1, View處理, tab處理);
AddTabButton(MultiView1, View查詢, tab查詢);
if (!IsPostBack)
{
ActivateTab(MultiView1, View處理);
}
else
{
Grid_View.DataBind();
Form_View.DataBind();
}
if (Form_View.CurrentMode != FormViewMode.ReadOnly)
{
Grid_View.Visible = false;
}
}
protected void btnSearch_Click(object sender, EventArgs e)
{
Grid_View.PageIndex = 0;
Grid_View.DataBind();
}
protected void btnClear_Click(object sender, EventArgs e)
{
txt訓練對象_Search.Text = "";
txt課程名稱_Search.Text = "";
txt課程編號_Search.Text = "";
ddl課程類別_Search.SelectedValue = "";
}
protected override void FormView_InsertDataBound(object sender, EventArgs e)
{
base.FormView_InsertDataBound(sender, e);
FindControl<ITextControl>(Form_View, "txt課程時數").Text = "0";
}
protected override void FormView_ItemDeleting(object sender, FormViewDeleteEventArgs e)
{
base.FormView_ItemDeleting(sender, e);
if (Dao課程.IsOccipued(DAC.GetString(e.Keys["課程編號"])))
{
ClientShowMessage("此課程已經選用過,不可刪除!");
e.Cancel = true;
}
}
protected override void GridView_DataSource_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
base.GridView_DataSource_Selected(sender, e);
if (MultiView1.ActiveViewIndex == 0)
{
if (e.ReturnValue is List list && list.Count > 0)
ActivateTab(MultiView1, View處理);
else
lbMessage.Text = "找不到合乎條件的資料";
}
}
protected void dsForm_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao課程;
}
protected void dsGrid_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao課程;
}
protected void dsBCLS_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao類別;
}
}
}
@@ -0,0 +1,215 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class
{
/// <summary>
/// tab處理 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton tab處理;
/// <summary>
/// tab查詢 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton tab查詢;
/// <summary>
/// MultiView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.MultiView MultiView1;
/// <summary>
/// View查詢 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.View View查詢;
/// <summary>
/// btnSearch 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnSearch;
/// <summary>
/// btnClear 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnClear;
/// <summary>
/// lb課程類別Label3 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb課程類別Label3;
/// <summary>
/// ddl課程類別_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.WDropDownList ddl課程類別_Search;
/// <summary>
/// lb課程編號Label3 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb課程編號Label3;
/// <summary>
/// txt課程編號_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt課程編號_Search;
/// <summary>
/// lb課程名稱Label3 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb課程名稱Label3;
/// <summary>
/// txt課程名稱_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt課程名稱_Search;
/// <summary>
/// lb訓練對象Label3 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb訓練對象Label3;
/// <summary>
/// txt訓練對象_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt訓練對象_Search;
/// <summary>
/// lbMessage 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbMessage;
/// <summary>
/// View處理 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.View View處理;
/// <summary>
/// dsForm 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource dsForm;
/// <summary>
/// dsGrid 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource dsGrid;
/// <summary>
/// dsBCLS 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource dsBCLS;
/// <summary>
/// dsBCLS0 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource dsBCLS0;
/// <summary>
/// FormView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.FormView FormView1;
/// <summary>
/// GridView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView GridView1;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,610 @@
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<DateTextBox>(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<Label>(Form_View, "lb編號");
if (lb編號 != null)
= DAC.GetInt32(lb編號.Text);
Image image1 = FindControl<Image>(Form_View, "Image1");
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");
}
}
System.Data.DataTable 滿 = Dao講師.Select滿意度統計();
if (Form_View.CurrentMode == FormViewMode.ReadOnly)
{
if (滿.Rows.Count > 0)
{
Label lb授課5分 = FindControl<Label>(Form_View, "lb授課5分");
Label lb授課4分 = FindControl<Label>(Form_View, "lb授課4分");
Label lb授課3分 = FindControl<Label>(Form_View, "lb授課3分");
Label lb授課2分 = FindControl<Label>(Form_View, "lb授課2分");
Label lb授課1分 = FindControl<Label>(Form_View, "lb授課1分");
Label lb授課總分 = FindControl<Label>(Form_View, "lb授課總分");
Label lb專業5分 = FindControl<Label>(Form_View, "lb專業5分");
Label lb專業4分 = FindControl<Label>(Form_View, "lb專業4分");
Label lb專業3分 = FindControl<Label>(Form_View, "lb專業3分");
Label lb專業2分 = FindControl<Label>(Form_View, "lb專業2分");
Label lb專業1分 = FindControl<Label>(Form_View, "lb專業1分");
Label lb專業總分 = FindControl<Label>(Form_View, "lb專業總分");
Label lb總分 = FindControl<Label>(Form_View, "lb總分");
if (lb授課5分 != null)
lb授課5分.Text = DAC.GetString(滿.Rows[0]["授課滿意度5"]);
if (lb授課4分 != null)
lb授課4分.Text = DAC.GetString(滿.Rows[0]["授課滿意度4"]);
if (lb授課3分 != null)
lb授課3分.Text = DAC.GetString(滿.Rows[0]["授課滿意度3"]);
if (lb授課2分 != null)
lb授課2分.Text = DAC.GetString(滿.Rows[0]["授課滿意度2"]);
if (lb授課1分 != null)
lb授課1分.Text = DAC.GetString(滿.Rows[0]["授課滿意度1"]);
if (lb授課總分 != null)
lb授課總分.Text = String.Format("{0:##0.00}", 滿.Rows[0]["授課滿意度總分"]);
if (lb專業5分 != null)
lb專業5分.Text = DAC.GetString(滿.Rows[0]["專業滿意度5"]);
if (lb專業4分 != null)
lb專業4分.Text = DAC.GetString(滿.Rows[0]["專業滿意度4"]);
if (lb專業3分 != null)
lb專業3分.Text = DAC.GetString(滿.Rows[0]["專業滿意度3"]);
if (lb專業2分 != null)
lb專業2分.Text = DAC.GetString(滿.Rows[0]["專業滿意度2"]);
if (lb專業1分 != null)
lb專業1分.Text = DAC.GetString(滿.Rows[0]["專業滿意度1"]);
if (lb專業總分 != null)
lb專業總分.Text = String.Format("{0:##0.00}", 滿.Rows[0]["專業滿意度總分"]);
if (lb總分 != null)
lb總分.Text = String.Format("{0:##0.00}", (DAC.GetDouble(滿.Rows[0]["授課滿意度總分"]) + DAC.GetDouble(滿.Rows[0]["專業滿意度總分"])) / 2);
}
System.Data.DataTable = Dao講師.Select講師評鑑統計();
if (.Rows.Count > 0)
{
Label lb講師評鑑_專業度 = FindControl<Label>(Form_View, "lb講師評鑑_專業度");
Label lb講師評鑑_授課技巧 = FindControl<Label>(Form_View, "lb講師評鑑_授課技巧");
Label lb講師評鑑_互動氛圍 = FindControl<Label>(Form_View, "lb講師評鑑_互動氛圍");
Label lb講師評鑑_內容切題 = FindControl<Label>(Form_View, "lb講師評鑑_內容切題");
Label lb講師評鑑_配合度 = FindControl<Label>(Form_View, "lb講師評鑑_配合度");
Label lb講師評鑑_總分 = FindControl<Label>(Form_View, "lb講師評鑑_總分");
Label lb講師評鑑_學員滿意度 = FindControl<Label>(Form_View, "lb講師評鑑_學員滿意度");
if (lb講師評鑑_專業度 != null)
lb講師評鑑_專業度.Text = string.Format("{0:###.00}", .Rows[0]["專業度"]);
if (lb講師評鑑_授課技巧 != null)
lb講師評鑑_授課技巧.Text = string.Format("{0:###.00}", .Rows[0]["授課技巧"]);
if (lb講師評鑑_互動氛圍 != null)
lb講師評鑑_互動氛圍.Text = string.Format("{0:###.00}", .Rows[0]["互動氛圍"]);
if (lb講師評鑑_內容切題 != null)
lb講師評鑑_內容切題.Text = string.Format("{0:###.00}", .Rows[0]["內容切題"]);
if (lb講師評鑑_配合度 != null)
lb講師評鑑_配合度.Text = string.Format("{0:###.00}", .Rows[0]["配合度"]);
if (lb講師評鑑_總分 != null)
lb講師評鑑_總分.Text = string.Format("{0:###.00}", .Rows[0]["總分"]);
if (lb講師評鑑_學員滿意度 != null)
lb講師評鑑_學員滿意度.Text = string.Format("{0:###.00}", .Rows[0]["學員滿意度"]);
}
}
RegisterPostbackTrigger(Form_View.FindControl("btnUploadPhoto"));
}
protected override void FormView_EditDataBound(object sender, EventArgs e)
{
RegisterPostbackTrigger(Form_View.FindControl("btnSave"));
base.FormView_EditDataBound(sender, e);
CheckBoxList cbl授課區域 = FindControl<CheckBoxList>(Form_View, "cbl授課區域");
List<string> s = new List<string>(DAC.GetString((Form_View.DataItem as ).).Split(','));
foreach (ListItem item in cbl授課區域.Items)
{
item.Selected = s.Contains(item.Value);
}
}
protected override void FormView_ItemInserting(object sender, FormViewInsertEventArgs e)
{
base.FormView_ItemInserting(sender, e);
Get授課區域();
}
private void Get授課區域()
{
CheckBoxList cbl授課區域 = FindControl<CheckBoxList>(Form_View, "cbl授課區域");
= "";
foreach (ListItem item in cbl授課區域.Items)
{
if (item.Selected)
+= item.Value + ",";
}
if (.Length > 0)
= .Remove(.Length - 1);
}
protected override void FormView_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
base.FormView_ItemInserted(sender, e);
//FileUpload fu = Form_View.FindControl("fu照片") as FileUpload;
//儲存照片與縮圖(fu, 新編號);
}
protected override void FormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
base.FormView_ItemUpdating(sender, e);
Get授課區域();
}
protected override void FormView_ItemUpdated(object sender, FormViewUpdatedEventArgs e)
{
base.FormView_ItemUpdated(sender, e);
//FileUpload fu = Form_View.FindControl("fu照片") as FileUpload;
//儲存照片與縮圖(fu, DAC.GetInt32(e.Keys["編號"]));
}
protected override void FormView_ItemDeleting(object sender, FormViewDeleteEventArgs e)
{
base.FormView_ItemDeleting(sender, e);
if (Dao講師.IsOccipued(DAC.GetInt32(e.Keys["編號"])))
{
e.Cancel = true;
ClientShowMessage("此講師已經選用過,不可刪除!");
}
}
protected override void FormView_ItemDeleted(object sender, FormViewDeletedEventArgs e)
{
base.FormView_ItemDeleted(sender, e);
// 刪除縮圖
string s = String.Format("{0}T_{1:000000}.jpg", , e.Keys["編號"]);
if (File.Exists(s))
File.Delete(s);
}
protected override void FormView_DataSource_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
{
base.FormView_DataSource_Inserting(sender, e);
(e.InputParameters["Value"] as ). = ;
}
protected override void FormView_DataSource_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
{
base.FormView_DataSource_Inserted(sender, e);
= (e.ReturnValue as ).;
}
protected override void FormView_DataSource_Updating(object sender, ObjectDataSourceMethodEventArgs e)
{
base.FormView_DataSource_Updating(sender, e);
(e.InputParameters["Value"] as ). = ;
}
protected override void GridView_DataSource_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
base.GridView_DataSource_Selected(sender, e);
if (MultiView1.ActiveViewIndex == 0)
{
if (e.ReturnValue is List list)
if (list.Count > 0)
lbMessage.Text = "";
else
lbMessage.Text = "找不到合乎條件的資料,請更改條件重新查詢。";
}
}
protected override void GridView_SelectedIndexChanged(object sender, EventArgs e)
{
base.GridView_SelectedIndexChanged(sender, e);
ActivateTab(MultiView1, 1);
}
protected void (FileUpload fu, int )
{
if (fileOK)
{
try
{
string tFullName = String.Format("{0}T_{1:000000}.jpg", , );
MemoryStream ms = PictureProcess.(fu.PostedFile.InputStream, 300, 300);
File.WriteAllBytes(tFullName, ms.ToArray());
ms.Dispose();
tFullName = String.Format("{0}{1:000000}.jpg", , );
ms = PictureProcess.(fu.PostedFile.InputStream, 1200, 1200);
File.WriteAllBytes(tFullName, ms.ToArray());
ms.Dispose();
}
catch
{
throw;
}
}
}
private void ()
{
// 處理上傳照片
string ext = "";
FileUpload fu = FindControl<FileUpload>(Form_View, "fu照片");
if (fu.HasFile && fu.PostedFile.ContentType.ToLower().IndexOf("image") >= 0)
{
// 檢查副檔名
ext = Path.GetExtension(fu.FileName).ToLower();
String[] allowedExt = { ".gif", ".jpeg", ".jpg", ".png" };
for (int i = 0; i < allowedExt.Length; i++)
{
if (ext == allowedExt[i])
{
fileOK = true;
}
}
// 檢查檔案大小
if (fileOK && fu.PostedFile.ContentLength < 5242880)
fileOK = true;
else
fileOK = false;
}
else
{
fileOK = false;
}
}
protected void btnSearch_Click(object sender, EventArgs e)
{
Grid_View.PageIndex = 0;
Grid_View.DataBind();
}
protected void btnClear_Click(object sender, EventArgs e)
{
lbMessage.Text = "";
txt講師姓名.Text = "";
ddl講師地區.SelectedValue = "";
ddl講師學歷.SelectedValue = "";
// txt講師滿意度1.Text = "";
// txt講師滿意度2.Text = "";
ddl合作狀態_search.SelectedValue = "";
ddl授課專長領域Search.SelectedValue = "";
ddl推薦授課主題Search.SelectedValue = "";
txt關鍵字.Text = "";
txt講師評鑑1.Text = "";
txt講師評鑑2.Text = "";
for (var i = 0; i < cbl關鍵字.Items.Count; i++)
{
cbl關鍵字.Items[i].Selected = true;
}
}
protected void btnInsert_Click(object sender, EventArgs e)
{
ActivateTab(MultiView1, 1);
Form_View.ChangeMode(FormViewMode.Insert);
}
protected void dsForm_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao講師;
}
protected void FormView1_ItemCommand(object sender, FormViewCommandEventArgs e)
{
if (e.CommandName == "刪除照片")
{
string fileName = String.Format("{0}T_{1:000000}.jpg", , DAC.GetInt32(e.CommandArgument));
if (File.Exists(fileName))
File.Delete(fileName);
fileName = String.Format("{0}{1:000000}.jpg", , DAC.GetInt32(e.CommandArgument));
if (File.Exists(fileName))
File.Delete(fileName);
Form_View.DataBind();
}
if (e.CommandName == "上傳照片")
{
FileUpload fuFile = FindControl<FileUpload>(Form_View, "fu照片");
if (fuFile.HasFile)
{
();
(fuFile, DAC.GetInt32(e.CommandArgument));
Form_View.DataBind();
}
}
if (e.CommandName == "Cancel")
{
if (Form_View.CurrentMode == FormViewMode.Insert)
{
ActivateTab(MultiView1, 0);
}
}
}
protected void cv授課區域_ServerValidate(object source, ServerValidateEventArgs args)
{
Get授課區域();
args.IsValid = .Trim().Length > 0;
}
protected override void FormView_ModeChanged(object sender, EventArgs e)
{
base.FormView_ModeChanged(sender, e);
Grid_View.Visible = true;
}
protected void dsGrid_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["關鍵字欄位"] = Get關鍵字欄位String();
}
private string Get關鍵字欄位String()
{
var = new List<string>();
for (var i = 0; i < cbl關鍵字.Items.Count; i++)
{
if (cbl關鍵字.Items[i].Selected)
.Add(cbl關鍵字.Items[i].Value);
}
return string.Join("|", .ToArray());
}
protected void btnExport_Click(object sender, EventArgs e)
{
if (!canExport)
{
return;
}
var export_columns = new List<string>();
for (var i = 0; i < cblExport.Items.Count; i++)
{
if (cblExport.Items[i].Selected)
export_columns.Add(cblExport.Items[i].Value);
}
var report = new Report.()
{
data = Dao講師.(true, 0, Int32.MaxValue,
txt講師姓名.Text, ddl講師地區.SelectedValue,
ddl授課專長領域Search.SelectedValue, ddl講師學歷.SelectedValue,
0, 0, ddl合作狀態_search.SelectedValue,
txt關鍵字.Text, Get關鍵字欄位String(), ddl推薦授課主題Search.SelectedValue,
DAC.GetInt32(txt講師評鑑1.Text), DAC.GetInt32(txt講師評鑑2.Text)),
export_columns = export_columns
};
MemoryStream ms = report.DoReport();
ResponseWriteStream(ms, String.Format("{0:yyyyMMdd_HHmmss}_講師資料匯出.xlsx", PublicVariable.TaiwanNow));
}
protected void btn講師評鑑查詢_Click(object sender, EventArgs e)
{
gv講師外訓滿意度.PageIndex = 0;
gv講師外訓滿意度.DataBind();
}
protected void btn講師評鑑查詢清除_Click(object sender, EventArgs e)
{
lbMessageEval.Text = "";
txt日期_1_Search.Text = "";
txt日期_2_Search.Text = "";
txt地點_Search.Text = "";
txt人數_1_Search.Text = "";
txt人數_2_Search.Text = "";
txt對象_Search.Text = "";
txt課程名稱_Search.Text = "";
gv講師外訓滿意度.PageIndex = 0;
gv講師外訓滿意度.DataBind();
}
protected void gv講師外訓滿意度_DataBound(object sender, EventArgs e)
{
if (gv講師外訓滿意度.Rows.Count == 0 && gv講師外訓滿意度.PageCount > 0)
{
gv講師外訓滿意度.PageIndex = gv講師外訓滿意度.PageCount - 1;
gv講師外訓滿意度.DataBind();
}
}
protected void ds講師外訓滿意度Grid_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
//if (MultiView1.ActiveViewIndex == 2)
//{
if (e.ReturnValue is 滿List list)
{
var count = list.Count;
if (count == 0)
lbMessageEval.Text = "找不到合乎條件的資料";
else
lbMessageEval.Text = "";
double tot專業度 = 0;
double tot授課技巧 = 0;
double tot互動氛圍 = 0;
double tot內容切題 = 0;
double tot配合度 = 0;
double tot合計 = 0;
double tot學員滿意度 = 0;
foreach (var row in list)
{
tot專業度 += (double)row. ;
tot授課技巧 += (double)row. ;
tot互動氛圍 += (double)row. ;
tot內容切題 += (double)row. ;
tot配合度 += (double)row. ;
tot合計 += (double)row. ;
tot學員滿意度 += (double)row.滿;
}
if (count > 0)
{
avg專業度 = Math.Round(tot專業度 / count, 2);
avg授課技巧 = Math.Round(tot授課技巧 / count, 2);
avg互動氛圍 = Math.Round(tot互動氛圍 / count, 2);
avg內容切題 = Math.Round(tot內容切題 / count, 2);
avg配合度 = Math.Round(tot配合度 / count, 2);
avg合計 = Math.Round(tot合計 / count, 2);
avg學員滿意度 = Math.Round(tot學員滿意度 / count, 2);
}
else
{
avg專業度 = 0;
avg授課技巧 = 0;
avg互動氛圍 = 0;
avg內容切題 = 0;
avg配合度 = 0;
avg合計 = 0;
avg學員滿意度 = 0;
}
}
//}
}
protected double avg專業度, avg授課技巧, avg互動氛圍, avg內容切題, avg配合度, avg合計, avg學員滿意度;
protected void cv身份證字號_ServerValidate(object source, ServerValidateEventArgs args)
{
var = Form_View.DataItem == null ? 0 : DAC.GetInt32((Form_View.DataItem as ).);
args.IsValid = !Dao講師.Is身份證字號Dulicate(, args.Value);
}
protected override void AfterChangeTab()
{
base.AfterChangeTab();
InitJSVar();
}
private void InitJSVar()
{
if (Grid_View.SelectedDataKey != null)
{
var = DAC.GetInt32(Grid_View.SelectedDataKey["編號"]);
var = string.Empty;
var = Dao講師.SelectOne().FirstOrDefault();
if ( != null) = .;
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "Init",
$@"V人員類別 = '講師'; V講師編號 = 'T{講師編號:0000}'; V講師姓名 = '{講師姓名}';", true);
}
}
}
}
@@ -0,0 +1,629 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class
{
/// <summary>
/// dsGrid 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource dsGrid;
/// <summary>
/// dsForm 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource dsForm;
/// <summary>
/// ds學歷 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds學歷;
/// <summary>
/// ds授課區域 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds授課區域;
/// <summary>
/// ds授課區域0 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds授課區域0;
/// <summary>
/// ds片語合作狀態 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds片語合作狀態;
/// <summary>
/// ds片語合作方式 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds片語合作方式;
/// <summary>
/// ds片語證照資料 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds片語證照資料;
/// <summary>
/// ds片語異常標註 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds片語異常標註;
/// <summary>
/// ds片語講師來源 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds片語講師來源;
/// <summary>
/// ds片語推薦授課主題 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds片語推薦授課主題;
/// <summary>
/// ds片語授課專長領域 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds片語授課專長領域;
/// <summary>
/// ds片語推薦授課主題Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds片語推薦授課主題Search;
/// <summary>
/// ds片語授課專長領域Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds片語授課專長領域Search;
/// <summary>
/// ds講師合作狀態 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds講師合作狀態;
/// <summary>
/// btnTab1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnTab1;
/// <summary>
/// btnTab2 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnTab2;
/// <summary>
/// btnTab3 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnTab3;
/// <summary>
/// btnTab4 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnTab4;
/// <summary>
/// MultiView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.MultiView MultiView1;
/// <summary>
/// View查詢 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.View View查詢;
/// <summary>
/// Label3 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label3;
/// <summary>
/// txt講師姓名 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt講師姓名;
/// <summary>
/// Label19 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label19;
/// <summary>
/// ddl講師地區 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.WDropDownList ddl講師地區;
/// <summary>
/// Label21 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label21;
/// <summary>
/// ddl授課專長領域Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.WDropDownList ddl授課專長領域Search;
/// <summary>
/// Label22 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label22;
/// <summary>
/// ddl講師學歷 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.WDropDownList ddl講師學歷;
/// <summary>
/// Label11 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label11;
/// <summary>
/// ddl合作狀態_search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.WDropDownList ddl合作狀態_search;
/// <summary>
/// Label13 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label13;
/// <summary>
/// txt講師評鑑1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt講師評鑑1;
/// <summary>
/// txt講師評鑑2 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt講師評鑑2;
/// <summary>
/// Label15 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label15;
/// <summary>
/// ddl推薦授課主題Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.WDropDownList ddl推薦授課主題Search;
/// <summary>
/// Label12 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label12;
/// <summary>
/// txt關鍵字 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt關鍵字;
/// <summary>
/// cbl關鍵字 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBoxList cbl關鍵字;
/// <summary>
/// btnSearch 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnSearch;
/// <summary>
/// btnClear 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnClear;
/// <summary>
/// hfCanExport 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hfCanExport;
/// <summary>
/// lbMessage 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbMessage;
/// <summary>
/// btnExport 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnExport;
/// <summary>
/// cblExport 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBoxList cblExport;
/// <summary>
/// GridView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView GridView1;
/// <summary>
/// View處理 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.View View處理;
/// <summary>
/// FormView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.FormView FormView1;
/// <summary>
/// View講師評鑑 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.View View講師評鑑;
/// <summary>
/// lb日期Label 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb日期Label;
/// <summary>
/// txt日期_1_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.DateTextBox txt日期_1_Search;
/// <summary>
/// txt日期_2_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.DateTextBox txt日期_2_Search;
/// <summary>
/// lb地點Label 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb地點Label;
/// <summary>
/// txt地點_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt地點_Search;
/// <summary>
/// lb人數Label 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb人數Label;
/// <summary>
/// txt人數_1_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt人數_1_Search;
/// <summary>
/// txt人數_2_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt人數_2_Search;
/// <summary>
/// lb對象Label 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb對象Label;
/// <summary>
/// txt對象_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt對象_Search;
/// <summary>
/// lb課程名稱Label 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb課程名稱Label;
/// <summary>
/// txt課程名稱_Search 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt課程名稱_Search;
/// <summary>
/// btn講師評鑑查詢 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btn講師評鑑查詢;
/// <summary>
/// btn講師評鑑查詢清除 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btn講師評鑑查詢清除;
/// <summary>
/// lbMessageEval 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbMessageEval;
/// <summary>
/// gv講師外訓滿意度 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gv講師外訓滿意度;
/// <summary>
/// ds講師外訓滿意度Grid 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds講師外訓滿意度Grid;
/// <summary>
/// View付款設定 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.View View付款設定;
/// <summary>
/// Uc付款設定 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::Education. Uc付款設定;
}
}