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,110 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/PopupForm.Master" AutoEventWireup="true"
CodeBehind="ShowCourseDetail.aspx.cs" Inherits="Education.Forms.選課.ShowCourseDetail" %>
<%@ Register Src="~/Forms/Common/起訖日顯示.ascx" TagPrefix="uc1" TagName="起訖日顯示" %>
<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="SelectOne" TypeName="Education.DAC_訓練課程企劃">
<SelectParameters>
<asp:QueryStringParameter Name="編號" QueryStringField="id" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ds課程內容" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="SelectBy課程企劃" TypeName="Education.DAC_訓練課程內容">
<SelectParameters>
<asp:QueryStringParameter Name="訓練課程企劃編號" QueryStringField="id" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:FormView ID="FormView1" runat="server" DataSourceID="ds課程企劃" EnableModelValidation="True">
<ItemTemplate>
<table border="0" style="table-layout: fixed;">
<tr>
<td class="widthcontrol" colspan="1" style="width: 80px;"></td>
<td class="widthcontrol" colspan="1" style="width: 120px;"></td>
<td class="widthcontrol" colspan="1" style="width: 80px;"></td>
<td class="widthcontrol" colspan="1" style="width: 120px;"></td>
<td class="widthcontrol" colspan="1" style="width: 80px;"></td>
<td class="widthcontrol" colspan="1" style="width: 120px;"></td>
<td class="widthcontrol" colspan="1" style="width: 80px;"></td>
<td class="widthcontrol" colspan="1" 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" 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="5">
<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">
<uc1:起訖日顯示 runat="server" ID="起訖日顯示" 起日='<%# Eval("訓練日期") %>' 迄日='<%# Eval("訓練日期迄") %>'
Format="yyyy-MM-dd" />
</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="7">
<asp:Label ID="lb訓練地點" runat="server" Text="<%# Get訓練地點() %>"></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:FormView>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="fixedwithborder"
DataKeyNames="訓練課程企劃編號,課程序號" DataSourceID="ds課程內容" EnableModelValidation="True">
<Columns>
<asp:BoundField DataField="節次" HeaderText="節次" SortExpression="節次">
<HeaderStyle Width="60px" />
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="日期時間">
<ItemTemplate>
<asp:Label ID="lb訓練日期" runat="server" MaxLength="5" Text='<%# Eval("訓練日期", "{0:yyyy-MM-dd}") %>'></asp:Label><br />
<asp:Label ID="lb時間" runat="server" MaxLength="5" Text='<%# Education.訓練課程內容.Get起訖時間Str(Eval("時間起"), Eval("時間迄")) %>'></asp:Label>
</ItemTemplate>
<HeaderStyle Width="150px" />
<ItemStyle Width="150px" HorizontalAlign="Center" VerticalAlign="Top" />
</asp:TemplateField>
<asp:BoundField DataField="課程名稱" HeaderText="課程名稱" SortExpression="課程名稱" />
<asp:TemplateField HeaderText="課程大綱" SortExpression="課程大綱">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("課程大綱", "{0}").Replace("\r\n", "<br/>") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="時數" HeaderText="時數" SortExpression="時數">
<HeaderStyle Width="60px" />
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="講師" SortExpression="講師編號">
<ItemTemplate>
<asp:LinkButton ID="Label1" runat="server" Text='<%# Get課程講師姓名(Eval("課程序號")) %>'
OnClientClick='<%# GetOpenWindowJS("ShowTeacherDetail.aspx", "_teacherdetail", "id", GetData.取得選定講師(Eval("訓練課程企劃編號"), Eval("課程序號")).編號) %>'>
</asp:LinkButton>
</ItemTemplate>
<HeaderStyle Width="120px" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</asp:Content>
@@ -0,0 +1,40 @@
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 ShowCourseDetail : FormBase
{
protected int ID;
protected DAC_場地遴選 Dao場地遴選;
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "課程詳情";
Dao場地遴選 = new DAC_場地遴選(conn);
if (!IsPostBack)
{
ID = DAC.GetInt32(Request["id"]);
}
}
protected string Get訓練地點()
{
d = GetData.(ID);
return d.;
}
protected string Get課程講師姓名(object )
{
d = GetData.(ID, DAC.GetInt32());
return d.;
}
}
}
@@ -0,0 +1,53 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class ShowCourseDetail
{
/// <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>
/// 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;
}
}
@@ -0,0 +1,77 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/PopupForm.Master" AutoEventWireup="true"
CodeBehind="ShowTeacherDetail.aspx.cs" Inherits="Education.Forms.選課.ShowTeacherDetail" %>
<%@ 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"
OldValuesParameterFormatString="original_{0}"
SelectMethod="SelectOne" TypeName="Education.DAC_講師"
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>
<table border="0" style="table-layout: fixed;">
<tr>
<td colspan="1" class="widthcontrol" style="width: 120px;"></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>
<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" CssClass="inputFull"
Text='<%# Bind("姓名") %>'></asp:Label>
</td>
<td colspan="4"></td>
<td rowspan="5" style="text-align: center; vertical-align: top;">
<asp:Image ID="Image1" runat="server" EnableViewState="False"
ImageUrl='<%# Education.PublicVariable.講師照片路徑 + "T_" + Eval("編號", "{0:000000}") + ".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>
</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 colspan="6"></td>
</tr>
</table>
</ItemTemplate>
</asp:FormView>
</asp:Content>
@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebLib;
using System.IO;
namespace Education.Forms.
{
public partial class ShowTeacherDetail : FormBase
{
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "講師詳情";
Form_View = FormView1;
FormView_DataSource = dsForm;
}
protected void dsForm_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao講師;
}
protected override void FormView_ReadOnlyDataBound(object sender, EventArgs e)
{
base.FormView_ReadOnlyDataBound(sender, e);
int = 0;
Label lb編號 = (Form_View.FindControl("lb編號") as Label);
if (lb編號 != null)
= DAC.GetInt32(lb編號.Text);
Image image1 = (Form_View.FindControl("Image1") as Image);
if (image1 != null)
{
string[] tmp = image1.ImageUrl.Split('?');
if (tmp.Length > 0 && !File.Exists(Server.MapPath(tmp[0])))
{
image1.ImageUrl = "~/picture/nopicture.jpg";
image1.Attributes.Remove("onclick");
image1.Style.Remove("cursor");
}
else
{
image1.Attributes.Add("onclick", GetOpenWindowJS("../Common/ShowLargePicture.aspx", "_picture", "pic", String.Format(Education.PublicVariable. + "{0:000000}.jpg", )));
image1.Style.Add("cursor", "pointer");
}
}
}
}
}
@@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class ShowTeacherDetail
{
/// <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,22 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/PopupForm.Master" AutoEventWireup="true" CodeBehind="ViewVideo.aspx.cs" Inherits="Education.Forms.選課.ViewVideo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table style="width: 100%">
<tr>
<td class="caption" style="width: 80px; height: 100%">
<asp:Label ID="Label9" runat="server" Text="講師姓名"></asp:Label>
</td>
<td class="datadisplay">
<asp:Label ID="lb講師姓名" runat="server" Text=""></asp:Label></td>
<td class="caption" style="width: 80px;">
<asp:Label ID="Label1" runat="server" Text="課程名稱"></asp:Label></td>
<td class="datadisplay">
<asp:Label ID="lb課程名稱" runat="server" Text=""></asp:Label></td>
</tr>
</table>
<div style="width:800px; margin:0 auto">
<asp:Literal ID="ltVideo" runat="server"></asp:Literal>
</div>
</asp:Content>
@@ -0,0 +1,41 @@
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 ViewVideo : FormBase
{
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "數位課程觀看 >> 觀看課程影片";
int id = DAC.GetInt32(Request["id"]);
DAC_數位課程 Dao數位課程 = new DAC_數位課程(conn);
List d2 = Dao數位課程.SelectOne(id);
if (d2.Count > 0)
{
lb課程名稱.Text = d2[0].;
lb講師姓名.Text = d2[0].;
// 第 1 種
ltVideo.Text = String.Format("<iframe allowfullscreen=\"\" frameborder=\"0\" width=\"800\" height=\"600\" src=\"{0}?version=3&hd=1&rel=0&autoplay=1\" ></iframe>", d2[0].);
// ltVideo.Text = String.Format("<embed src=\"http://www.youtube.com/v/{0}?version=3&hl=zh_TW&hd=1&rel=0&autoplay=1\" type=\"application/x-shockwave-flash\" width=\"1000\" height=\"600\" allowscriptaccess=\"false\" allowfullscreen=\"true\"></embed>", d2[0].課程網址);
// ltVideo.Text = String.Format("<iframe allowfullscreen allowscriptaccess frameborder=\"0\" width=\"800\" height=\"600\" src=\"http://www.youtube.com/v/{0}?hd=1&rel=1&autoplay=1\"></iframe>", d2[0].課程網址);
// ltVideo.Text = String.Format("<object width=\"800\" height=\"600\"><param name=\"movie\" value=\"http://www.youtube.com/v/{0}?hd=1&rel=1&autoplay=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"false\"></param><embed src=\"http://www.youtube.com/v/{0}?hd=1&rel=1&autoplay=1\" type=\"application/x-shockwave-flash\" width=\"800\" height=\"600\" allowscriptaccess=\"false\" allowfullscreen=\"true\"></embed></object>", d2[0].課程網址);
// 第 4 種
///ltVideo.Text = String.Format("<iframe src=\"{0}\"></iframe>", d2[0].課程網址);
new DAC_數位課程觀看紀錄(conn).Insert(id, UserId, UserId);
}
}
}
}
@@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class ViewVideo
{
/// <summary>
/// Label9 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label9;
/// <summary>
/// lb講師姓名 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb講師姓名;
/// <summary>
/// Label1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label1;
/// <summary>
/// lb課程名稱 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb課程名稱;
/// <summary>
/// ltVideo 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltVideo;
}
}
@@ -0,0 +1,210 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true"
CodeBehind="受訓紀錄查詢.aspx.cs" Inherits="Education.Forms.選課.受訓紀錄查詢" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="weblib" %>
<%@ Register Src="~/Forms/Common/起訖日顯示.ascx" TagPrefix="uc1" TagName="起訖日顯示" %>
<%@ Register Src="~/Forms/辦訓狀況/UC出席狀況.ascx" TagPrefix="uc1" TagName="UC出席狀況" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:Panel ID="pnlSelect" runat="server" Visible="false">
<table>
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="員工編號"></asp:Label></td>
<td>
<weblib:LookupTextBox ID="txt員工編號" runat="server" LookupConfigName="BPSN" OutputControl="txt員工姓名" />
</td>
<td>
<asp:TextBox ID="txt員工姓名" runat="server"></asp:TextBox></td>
<td>
<asp:LinkButton ID="btnSearch" runat="server" CssClass="button blue60"
OnClick="btnSearch_Click">查詢</asp:LinkButton></td>
</tr>
</table>
<asp:Label ID="lbMessage" runat="server" Text="" EnableViewState="false" CssClass="ErrorMessage"></asp:Label>
</asp:Panel>
<asp:ObjectDataSource ID="ds選課" runat="server" OldValuesParameterFormatString="original_{0}"
OnObjectCreating="ds選課_ObjectCreating" OnSelecting="ds選課_Selecting" SelectMethod="Select選課紀錄"
TypeName="Education.DAC_課程報名">
<SelectParameters>
<asp:Parameter Name="學員編號" Type="String" />
<asp:Parameter Name="僅已簽核" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="僅必修" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="僅已上課" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="僅已出席" Type="Boolean" DefaultValue="false" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ds數位課程" runat="server" OldValuesParameterFormatString="original_{0}"
OnSelecting="ds數位課程_Selecting" SelectMethod="Select觀看紀錄" TypeName="Education.DAC_數位課程觀看紀錄">
<SelectParameters>
<asp:Parameter Name="學員編號" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource runat="server" ID="ds外部受訓紀錄" OldValuesParameterFormatString="original_{0}"
SelectMethod="Select" TypeName="Education.DAC_外部受訓紀錄" OnSelecting="ds外部受訓紀錄_Selecting">
<SelectParameters>
<asp:Parameter Name="noInputReturnAll" Type="Boolean" DefaultValue="False"></asp:Parameter>
<asp:Parameter Name="員工編號" Type="String" />
<asp:Parameter Name="實施單位" Type="String" DefaultValue="" />
<asp:Parameter Name="課程類別" Type="String" DefaultValue="" />
<asp:Parameter Name="訓練名稱" Type="String" DefaultValue="" />
<asp:Parameter Name="訓練年度" Type="Int32" DefaultValue="0" />
<asp:Parameter Name="訓練單位" Type="String" DefaultValue="" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ds持有證照" runat="server" DataObjectTypeName="Education.持有證照"
TypeName="Education.DAC_持有證照" OldValuesParameterFormatString="original_{0}"
SelectMethod="Select" OnSelecting="ds持有證照_Selecting">
<SelectParameters>
<asp:Parameter Name="noInputReturnAll" Type="Boolean" DefaultValue="False" />
<asp:Parameter Name="員工編號" Type="String" DefaultValue=""></asp:Parameter>
<asp:Parameter Name="證照名稱" Type="String" DefaultValue=""></asp:Parameter>
<asp:Parameter Name="證照字號" Type="String" DefaultValue=""></asp:Parameter>
<asp:Parameter Name="發證單位" Type="String" DefaultValue=""></asp:Parameter>
<asp:Parameter Name="核發日期" Type="DateTime" DefaultValue=""></asp:Parameter>
</SelectParameters>
</asp:ObjectDataSource>
<h3>1. 我的上課紀錄</h3>
<asp:GridView ID="gv上課紀錄" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataSourceID="ds選課" EnableModelValidation="True"
Width="100%">
<Columns>
<asp:TemplateField HeaderText="訓練日期" SortExpression="訓練日期">
<ItemTemplate>
<uc1:起訖日顯示 runat="server" ID="起訖日顯示" 起日='<%# Eval("訓練日期") %>'
迄日='<%# Eval("訓練日期迄") %>' Format="yyyy-MM-dd" />
</ItemTemplate>
<HeaderStyle Width="13em" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="訓練名稱" HeaderText="訓練名稱" SortExpression="訓練名稱"></asp:BoundField>
<asp:TemplateField HeaderText="出席狀況" SortExpression="出席狀況">
<ItemTemplate>
<uc1:UC出席狀況 runat="server" ID="UC出席狀況" 學員編號='<%# Eval("學員編號") %>' 訓練課程編號='<%# Eval("訓練課程編號") %>' />
</ItemTemplate>
<HeaderStyle Width="17em" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="滿意度調查&lt;br&gt;暨心得報告">
<ItemTemplate>
<asp:Label ID="Label41" runat="server" Font-Bold="true" Text='<%# WebLib.DAC.GetInt32(Eval("填寫數")) > 0 ? "已填寫" : "未填寫" %>'></asp:Label>&nbsp;
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="button blue80"
OnClientClick='<%# GetOpenWindowJS("~/Forms/辦訓狀況/滿意度調查表及心得報告.aspx", "_feedback", "course", Eval("訓練課程編號"), "student", Eval("學員編號")) %>'>填寫</asp:LinkButton>
</ItemTemplate>
<HeaderStyle Width="10em" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
<asp:Label ID="Label9" runat="server" CssClass="ErrorMessage" Text="您目前沒有任何上課紀錄"></asp:Label>
</EmptyDataTemplate>
<PagerTemplate>
<weblib:GridViewPager ID="GridViewPager1" runat="server" />
</PagerTemplate>
</asp:GridView>
<h3>2. 我的數位課程觀看紀錄</h3>
<asp:GridView ID="gv數位課程" runat="server" AutoGenerateColumns="False"
DataKeyNames="課程編號" DataSourceID="ds數位課程" EnableModelValidation="True"
AllowPaging="True" Width="100%">
<Columns>
<asp:BoundField DataField="課程編號" HeaderText="課程編號" ReadOnly="True" SortExpression="課程編號"
DataFormatString="{0:000000}">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="課程類別" SortExpression="">
<ItemTemplate>
<asp:Label ID="lb課程類別" runat="server" Text='<%# Eval("課程類別") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="課程名稱" HeaderText="課程名稱" SortExpression="課程名稱" />
<asp:BoundField DataField="講師" HeaderText="講師" SortExpression="講師">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="上次觀看日期">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# DAC.GetDateTime(Eval("觀看日期")).Ticks > 0 ? Eval("觀看日期", "{0:yyyy-MM-dd}") : "尚未觀看" %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
<asp:Label ID="Label1" runat="server" Text="您還沒有觀看過數位課程" CssClass="ErrorMessage"></asp:Label>
</EmptyDataTemplate>
<PagerTemplate>
<weblib:GridViewPager ID="GridViewPager1" runat="server" />
</PagerTemplate>
</asp:GridView>
<h3>3. 我的外部訓練</h3>
<asp:GridView runat="server" ID="gv外部受訓紀錄" DataSourceID="ds外部受訓紀錄"
DataKeyNames="員工編號,序號" AutoGenerateColumns="False" EnableModelValidation="True"
Width="100%" AllowPaging="true">
<Columns>
<asp:TemplateField HeaderText="序號" SortExpression="序號">
<ItemTemplate>
<asp:Label ID="Label11" runat="server" Text='<%# Bind("序號") %>'></asp:Label>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
CommandName="Select" Text=""></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="實施單位" HeaderText="實施單位" SortExpression="實施單位"></asp:BoundField>
<asp:TemplateField HeaderText="課程類別" SortExpression="課程類別">
<ItemTemplate>
<asp:Label ID="Label31" runat="server" Text='<%# Bind("課程類別") %>'></asp:Label>
<asp:Label ID="Label32" runat="server" Text='<%# Get類別名稱("課程類別", Eval("課程類別")) %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="訓練名稱" HeaderText="訓練名稱" SortExpression="訓練名稱" />
<asp:BoundField DataField="訓練年度" HeaderText="訓練年度" SortExpression="訓練年度">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="訓練時數" HeaderText="訓練時數" SortExpression="訓練時數">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="訓練單位" HeaderText="訓練單位" SortExpression="訓練單位"></asp:BoundField>
</Columns>
<EmptyDataTemplate>
<asp:Label ID="LabelEmpty" runat="server" CssClass="ErrorMessage" Text="您目前沒有登錄證照"></asp:Label>
</EmptyDataTemplate>
<PagerTemplate>
<weblib:gridviewpager id="GridViewPager1" runat="server" />
</PagerTemplate>
</asp:GridView>
<h3>4. 我的證照</h3>
<asp:GridView ID="gv持有證照" runat="server" DataKeyNames="員工編號,序號,DB_APPNO"
DataSourceID="ds持有證照" AutoGenerateColumns="False"
EnableModelValidation="True" AllowPaging="True" Width="100%"
OnRowDataBound="gv持有證照_RowDataBound">
<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" Text=""></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="證照名稱" HeaderText="證照名稱" SortExpression="證照名稱" />
<asp:BoundField DataField="證照字號" HeaderText="證照字號" SortExpression="證照字號" />
<asp:BoundField DataField="發證單位" HeaderText="發證單位" SortExpression="發證單位" />
<asp:BoundField DataField="核發日期" HeaderText="核發日期" SortExpression="核發日期" DataFormatString="{0:yyyyMMdd}">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="附件">
<ItemTemplate>
<asp:Literal ID="lt附件" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
<asp:Label ID="LabelEmpty" runat="server" CssClass="ErrorMessage" Text="您目前沒有登錄證照"></asp:Label>
</EmptyDataTemplate>
<PagerTemplate>
<weblib:gridviewpager id="GridViewPager1" runat="server" />
</PagerTemplate>
</asp:GridView>
</asp:Content>
@@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using WebLib;
namespace Education.Forms.
{
public partial class : FormBase
{
private DAC_學員出席 Dao學員出席;
private string ;
protected void Page_Load(object sender, EventArgs e)
{
if (IsBackend)
FunctionName = "學員訓練紀錄";
else
FunctionName = "受訓及滿意度紀錄查詢";
pnlSelect.Visible = IsBackend;
gv上課紀錄.Columns[3].Visible = !IsBackend;
Dao學員出席 = new DAC_學員出席(conn);
if (IsBackend)
= txt員工編號.Text;
else
= UserId;
if (IsPostBack)
{
gv上課紀錄.DataBind();
gv數位課程.DataBind();
gv外部受訓紀錄.DataBind();
gv持有證照.DataBind();
}
}
protected void ds選課_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao課程報名;
}
protected void ds選課_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["學員編號"] = ;
e.InputParameters["僅已簽核"] = IsBackend;
e.InputParameters["僅必修"] = IsBackend;
e.InputParameters["僅已上課"] = !IsBackend;
e.InputParameters["僅已出席"] = !IsBackend;
}
protected void ds數位課程_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["學員編號"] = ;
}
protected void ds外部受訓紀錄_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["員工編號"] = ;
}
protected void ds持有證照_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["員工編號"] = ;
}
protected void btnSearch_Click(object sender, EventArgs e)
{
if (txt員工編號.Text.Length == 0)
lbMessage.Text = "請輸入員工編號";
}
protected void gv持有證照_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (!(e.Row.DataItem is Education. data))
return;
string = data.;
int = data.;
string diskFileName = String.Format("{0}{1}_{2}.jpg", Server.MapPath(PublicVariable.), , );
string fileUrl = String.Format("{0}{1}_{2}.jpg", ResolveClientUrl(PublicVariable.), , );
ITextControl lt附件 = FindControl<ITextControl>(e.Row.Cells[5], "lt附件");
if (lt附件 != null)
{
if (System.IO.File.Exists(diskFileName))
{
lt附件.Text = String.Format("<a href=\"{0}\" target=\"_new\">下載</a>", fileUrl);
}
else
{
lt附件.Text = "";
}
}
}
}
}
}
@@ -0,0 +1,143 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class
{
/// <summary>
/// pnlSelect 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Panel pnlSelect;
/// <summary>
/// Label1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label1;
/// <summary>
/// txt員工編號 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.LookupTextBox txt員工編號;
/// <summary>
/// txt員工姓名 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt員工姓名;
/// <summary>
/// btnSearch 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnSearch;
/// <summary>
/// lbMessage 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbMessage;
/// <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>
/// gv上課紀錄 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gv上課紀錄;
/// <summary>
/// gv數位課程 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gv數位課程;
/// <summary>
/// gv外部受訓紀錄 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gv外部受訓紀錄;
/// <summary>
/// gv持有證照 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gv持有證照;
}
}
@@ -0,0 +1,93 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true"
CodeBehind="學員選課.aspx.cs" Inherits="Education.Forms.選課.學員選課" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="cc1" %>
<%@ Register Src="~/Forms/Common/起訖日顯示.ascx" TagPrefix="uc1" TagName="起訖日顯示" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table>
<tr>
<td class="caption">
<asp:Label ID="Label9" runat="server" Text="開課日期範圍"></asp:Label>
</td>
<td>
<cc1:DateTextBox ID="DateTextBox1" runat="server" DateSeparator="-" />
</td>
<td class="captionCenter">
<asp:Label ID="Label10" runat="server" Text="至"></asp:Label>
</td>
<td>
<cc1:DateTextBox ID="DateTextBox2" runat="server" DateSeparator="-" />
</td>
<td>
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="button blue80">查詢</asp:LinkButton>
<asp:Label ID="lbMemo" runat="server">(點擊訓練名稱可看詳情)</asp:Label>
</td>
</tr>
</table>
<asp:ObjectDataSource ID="ds課程企劃" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="SelectBy訓練日期" TypeName="Education.DAC_訓練課程企劃">
<SelectParameters>
<asp:ControlParameter ControlID="DateTextBox1" Name="訓練日期1" PropertyName="Value"
Type="DateTime" />
<asp:ControlParameter ControlID="DateTextBox2" Name="訓練日期2" PropertyName="Value"
Type="DateTime" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
Widrh="100%"
EnableModelValidation="True" CssClass="fixedwithborder" DataKeyNames="編號" DataSourceID="ds課程企劃"
PageSize="20" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="訓練日期" SortExpression="訓練日期">
<ItemTemplate>
<uc1:起訖日顯示 runat="server" ID="起訖日顯示" 起日='<%# Eval("訓練日期") %>' 迄日='<%# Eval("訓練日期迄") %>'
Format="yyyy-MM-dd" />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="訓練名稱" SortExpression="訓練名稱">
<ItemTemplate>
<asp:LinkButton runat="server" ID="hl編號" OnClientClick='<%# GetOpenWindowJS("ShowCourseDetail.aspx", "_coursedetail", "id", Eval("編號")) %>'
Text='<%# Bind("訓練名稱") %>'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="時數" SortExpression="訓練時數">
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Bind("訓練時數") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="70px" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="地點">
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Get訓練地點(Eval("編號")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="名額" SortExpression="人數">
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Get剩餘名額(Eval("編號"), Eval("人數")) %>'></asp:Label>
</ItemTemplate>
<HeaderStyle Width="90px" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="報名">
<ItemTemplate>
<asp:LinkButton ID="btn報名" runat="server" CommandArgument='<%# Eval("編號") %>' CommandName="報名"
CssClass="button blue80" Visible="False" EnableViewState="false">報名</asp:LinkButton>
<asp:Literal ID="lb狀態" runat="server" Text="" EnableViewState="false"></asp:Literal>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="150px" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
<asp:Label ID="Label11" runat="server" CssClass="ErrorMessage" Text="日期範圍內沒有開課資料,請輸入其他日期範圍查詢"></asp:Label>
</EmptyDataTemplate>
<PagerTemplate>
<cc1:GridViewPager ID="GridViewPager1" runat="server" />
</PagerTemplate>
</asp:GridView>
</asp:Content>
@@ -0,0 +1,128 @@
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
{
private DAC_場地遴選 Dao場地遴選;
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "課程查詢及線上報名";
Dao場地遴選 = new DAC_場地遴選(conn);
if (!IsPostBack)
{
// 查詢範圍初始值為本月月初至下個月月底
DateTextBox1.Value = new DateTime(DateTime.UtcNow.AddHours(8).Date.Year, DateTime.UtcNow.AddHours(8).Date.Month, 1);
DateTextBox2.Value = new DateTime(DateTime.UtcNow.AddHours(8).Date.Year, DateTime.UtcNow.AddHours(8).Date.Month, 1).AddMonths(2).AddDays(-1);
}
else
{
GridView1.DataBind();
}
}
protected string Get訓練地點(object ID)
{
return GetData.(DAC.GetInt32(ID)).;
}
protected string Get剩餘名額(object ID, object )
{
int = DAC.GetInt32();
int = Dao課程報名.Get報名人數(DAC.GetInt32(ID));
if ( > )
return String.Format("{0}", - );
else
return "額滿";
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
dataItem = e.Row.DataItem as ;
if (dataItem == null)
return;
TableCell cell = e.Row.Cells[5];
Literal lt狀態 = FindControl<Literal>(cell, "lb狀態");
lt狀態.Text = "";
string = Dao課程報名.Get報名狀態(UserId, dataItem.);
int = Dao課程報名.Get報名人數(dataItem.);
// 報名未開放
if (dataItem. > DateTime.UtcNow.AddHours(8).Date)
{
lt狀態.Text = "<div style=\"color:red\">尚未開放報名</div>";
return;
}
// 已截止報名
if (dataItem..AddDays(-dataItem.) <= DateTime.UtcNow.AddHours(8).Date)
{
lt狀態.Text += "<div style=\"color:red\">已截止報名</div>";
return;
}
// 已額滿
if ( >= dataItem.)
{
lt狀態.Text += "<div style=\"color:red\">已額滿</div>";
return;
}
// 報名狀態
if ( == "Y")
{
lt狀態.Text += "<div style=\"color:green\">已報名(選修)</div>";
return;
}
else if ( == "R")
{
lt狀態.Text += "<div style=\"color:green\">已報名(必修)</div>";
return;
}
// 可報名
if ( < dataItem. && == "S")
{
FindControl<Control>(cell, "btn報名").Visible = true;
}
}
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
// 處理報名動作
if (e.CommandName == "報名")
{
// 1. 寫一筆報名紀錄
int = DAC.GetInt32(e.CommandArgument);
Dao課程報名.(UserId, , UserId);
// 2. 發送報名確認郵件
List values = Dao訓練課程企劃.SelectOne();
string = Dao員工.Get電子郵件(UserId);
string = Dao員工.Get員工姓名(UserId);
if (values.Count > 0)
{
= new ();
.Context = this.Context;
.(, , values[0].,
values[0]., values[0].);
}
GridView1.DataBind();
}
}
}
}
@@ -0,0 +1,89 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class
{
/// <summary>
/// Label9 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label9;
/// <summary>
/// DateTextBox1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.DateTextBox DateTextBox1;
/// <summary>
/// Label10 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label10;
/// <summary>
/// DateTextBox2 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::WebLib.DateTextBox DateTextBox2;
/// <summary>
/// LinkButton1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton LinkButton1;
/// <summary>
/// lbMemo 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbMemo;
/// <summary>
/// ds課程企劃 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds課程企劃;
/// <summary>
/// GridView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView GridView1;
}
}
@@ -0,0 +1,96 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true" CodeBehind="數位課程觀看.aspx.cs" Inherits="Education.Forms.選課.數位課程觀看" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="cc1" %>
<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="Select可看課程" TypeName="Education.DAC_數位課程" OnObjectCreating="ds開放課程_ObjectCreating" OnSelecting="ds開放課程_Selecting">
<SelectParameters>
<asp:Parameter Name="學員編號" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="課程編號" DataSourceID="ds可看課程" EnableModelValidation="True"
AllowPaging="True" OnRowCommand="GridView1_RowCommand"
OnRowDataBound="GridView1_RowDataBound" Width="100%">
<Columns>
<asp:TemplateField HeaderText="" SortExpression="課程網址" Visible="false">
<ItemTemplate>
<asp:LinkButton ID="btn課程觀看" runat="server" CssClass="button blue80"
OnClientClick='<%# GetOpenWindowJS("ViewVideo.aspx", "viewvideo", "id", Eval("課程編號")) %>'
Text="觀看"></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="課程編號" HeaderText="課程編號" ReadOnly="True" SortExpression="課程編號" DataFormatString="{0:000000}">
<HeaderStyle Width="5em"/>
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="課程類別" SortExpression="">
<ItemTemplate>
<asp:Label ID="lb課程類別" runat="server" Text='<%# Get類別名稱("課程類別", Eval("課程類別")) %>'></asp:Label>
</ItemTemplate>
<HeaderStyle Width="8em"/>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="課程名稱" HeaderText="課程名稱" SortExpression="課程名稱" />
<asp:BoundField DataField="講師" HeaderText="講師" SortExpression="講師">
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle Width="5em"/>
</asp:BoundField>
<asp:TemplateField HeaderText="課程簡介" SortExpression="課程簡介" Visible="false">
<ItemTemplate>
<asp:LinkButton ID="btn課程簡介" runat="server"
OnClientClick='<%# GetOpenWindowJS("../Common/ShowContent.aspx", "onlinecoursecontent", "type", "OnlineCourse", "id", Eval("課程編號")) %>'
Text='<%# Eval("課程簡介", "{0}").Replace("\r\n", "<br>").Replace("\r", "<br>").Replace("\n", "<br>") %>'>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="課程文件" SortExpression="課程文件">
<ItemTemplate>
<asp:HyperLink ID="hl課程文件" runat="server" Target="_blank"
Text='<%# Eval("課程文件", "{0}").Length > 0 ? "下載" : "" %>'
NavigateUrl='<%# Eval("課程文件", "{0}").Length > 0 ? "~/DocUpload/" + Eval("課程文件", "{0}") : "" %>'></asp:HyperLink>
</ItemTemplate>
<HeaderStyle Width="4em"/>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="評量文件" SortExpression="評量文件">
<ItemTemplate>
<asp:HyperLink ID="hl評量文件" runat="server" Target="_blank"
Text='<%# Eval("評量文件", "{0}").Length > 0 ? "下載" : "" %>'
NavigateUrl='<%# Eval("評量文件", "{0}").Length > 0 ? "~/DocUpload/" + Eval("評量文件", "{0}") : "" %>'></asp:HyperLink>
</ItemTemplate>
<HeaderStyle Width="4em"/>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="課程網址" SortExpression="課程網址">
<ItemTemplate>
<asp:LinkButton ID="btn觀看課程" runat="server" CommandName="viewvideo"
CommandArgument='<%# Eval("課程編號") %>'
Text='<%# Eval("課程網址", "{0}").Length > 0 ? "觀看" : "" %>'
OnClientClick='<%# Eval("課程網址", "{0}").Length > 0 ? GetOpenPageJSNoReturn(Eval("課程網址", "{0}"), "_new", "id", Eval("課程編號", "{0}")) : "" %>'></asp:LinkButton>
</ItemTemplate>
<HeaderStyle Width="4em"/>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="長度" HeaderText="長度" SortExpression="長度">
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle Width="4em"/>
</asp:BoundField>
<asp:TemplateField HeaderText="上次觀看日期">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Get上次觀看日期(Eval("課程編號")) %>'></asp:Label>
</ItemTemplate>
<HeaderStyle Width="7em"/>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
<asp:Label ID="Label1" runat="server" Text="沒有合乎查詢條件的數位課程,請更改條件重新查詢" CssClass="ErrorMessage"></asp:Label>
</EmptyDataTemplate>
<PagerTemplate>
<cc1:GridViewPager ID="GridViewPager1" runat="server" />
</PagerTemplate>
</asp:GridView>
</asp:Content>
@@ -0,0 +1,74 @@
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
{
DAC_數位課程 Dao數位課程;
DAC_數位課程觀看紀錄 Dao數位課程觀看紀錄;
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "數位課程觀看";
Dao數位課程 = new DAC_數位課程(conn);
Dao數位課程觀看紀錄 = new DAC_數位課程觀看紀錄(conn);
if (IsPostBack)
GridView1.DataBind();
}
protected string Get上次觀看日期(object )
{
List d = Dao數位課程觀看紀錄.SelectOne(DAC.GetInt32(), UserId);
if (d.Count > 0)
return d[0]..ToString("yyyy-MM-dd");
else
return "";
}
protected void ds開放課程_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["學員編號"] = UserId;
}
protected void ds開放課程_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao數位課程;
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "viewvideo")
{
int = DAC.GetInt32(e.CommandArgument);
new DAC_數位課程觀看紀錄(conn).Insert(, UserId, UserId);
// 數位課程List d = Dao數位課程.SelectOne(課程編號);
/*
if (d.Count > 0)
{
//ClientScript.RegisterStartupScript(Page.GetType(), "viewvideo",
// GetOpenWindowJS(d[0].課程網址, "_blank", false), true);
ClientScript.RegisterStartupScript(Page.GetType(), "viewvideo",
GetOpenWindowJS("ViewVideo.aspx?id=" + 課程編號.ToString(), "_blank", false), true);
GridView1.DataBind();
}
*/
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
// 註冊 Postback Trigger
RegisterPostbackTrigger(e.Row.FindControl("btn課程簡介"));
// RegisterPostbackTrigger(e.Row.FindControl("btn觀看課程"));
}
}
}
@@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class
{
/// <summary>
/// ds可看課程 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds可看課程;
/// <summary>
/// GridView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView GridView1;
}
}
@@ -0,0 +1,86 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true"
CodeBehind="選課查詢.aspx.cs" Inherits="Education.Forms.選課.選課查詢" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="cc1" %>
<%@ Register Src="~/Forms/Common/起訖日顯示.ascx" TagPrefix="uc1" TagName="起訖日顯示" %>
<%@ Register Src="~/Forms/辦訓狀況/UC出席狀況.ascx" TagPrefix="uc1" TagName="UC出席狀況" %>
<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}"
OnObjectCreating="ds選課_ObjectCreating" SelectMethod="Select選課紀錄" TypeName="Education.DAC_課程報名"
OnSelecting="ds選課_Selecting">
<SelectParameters>
<asp:Parameter Name="學員編號" Type="String" />
<asp:Parameter Name="僅已簽核" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="僅必修" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="僅已上課" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="僅已出席" Type="Boolean" DefaultValue="false" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
PageSize="20" DataSourceID="ds選課" EnableModelValidation="True" CssClass="fixedwithborder"
OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound"
Width="100%">
<Columns>
<asp:TemplateField HeaderText="訓練日期" SortExpression="訓練日期">
<ItemTemplate>
<uc1:起訖日顯示 runat="server" id="起訖日顯示" 起日='<%# Eval("訓練日期") %>' 迄日='<%# Eval("訓練日期迄") %>'
format="yyyy-MM-dd" />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="13em" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="訓練名稱" SortExpression="訓練名稱">
<ItemTemplate>
<asp:LinkButton runat="server" ID="hl編號" OnClientClick='<%# GetOpenWindowJS("ShowCourseDetail.aspx", "_coursedetail", "id", Eval("訓練課程編號")) %>'
Text='<%# Bind("訓練名稱") %>'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="報名狀態" SortExpression="報名狀態">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("報名狀態", "{0}") == "R" ? "已報名(必修)" : (Eval("報名狀態", "{0}") == "Y" ? "已報名(選修)" : ( Eval("報名狀態", "{0}") == "N" ? "已取消" : (Eval("報名狀態", "{0}") == "S" ? "未報名(選修)" : ""))) %>'></asp:Label>
</ItemTemplate>
<HeaderStyle Width="6.5em" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="報名日期" SortExpression="報名日期">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("報名日期", "{0:yyyy-MM-dd}") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle Width="6.5em" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="取消報名日期" SortExpression="取消報名日期">
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("取消報名日期", "{0:yyyy-MM-dd}") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle Width="6.5em" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="出席狀況" SortExpression="出席狀況">
<ItemTemplate>
<uc1:UC出席狀況 runat="server" ID="UC出席狀況" 學員編號='<%# Eval("學員編號") %>' 訓練課程編號='<%# Eval("訓練課程編號") %>' />
</ItemTemplate>
<HeaderStyle Width="12em" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="取消報名">
<ItemTemplate>
<asp:LinkButton ID="btn取消報名" runat="server" Visible="false" CommandName="取消報名" CommandArgument='<%# Eval("訓練課程編號") %>'
CssClass="button red80">取消報名</asp:LinkButton>
<asp:Literal ID="lb狀態" runat="server" Text="" EnableViewState="false"></asp:Literal>
</ItemTemplate>
<HeaderStyle Width="6.5em" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
<asp:Label ID="Label9" runat="server" CssClass="ErrorMessage" Text="您目前沒有任何選課紀錄"></asp:Label>
</EmptyDataTemplate>
<PagerTemplate>
<cc1:GridViewPager ID="GridViewPager1" runat="server" />
</PagerTemplate>
</asp:GridView>
</asp:Content>
@@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using WebLib;
namespace Education.Forms.
{
public partial class : FormBase
{
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "報名查詢及取消報名";
if (IsPostBack)
{
GridView1.DataBind();
}
}
protected void ds選課_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao課程報名;
}
protected void ds選課_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["學員編號"] = UserId;
e.InputParameters["僅已簽核"] = IsBackend;
e.InputParameters["僅必修"] = false;
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (!(e.Row.DataItem is DataRowView dataItem))
return;
TableCell cell = e.Row.Cells[6];
Literal lt狀態 = FindControl<Literal>(cell, "lb狀態");
lt狀態.Text = "";
int = DAC.GetInt32(dataItem["訓練課程編號"]);
string = DAC.GetString(dataItem["報名狀態"]);
DateTime = DAC.GetDateTime(dataItem["訓練日期"]);
int = DAC.GetInt32(dataItem["取消報名截止期限"]);
// 已過訓練日期,狀態均不顯示
if ( < DateTime.UtcNow.AddHours(8).Date)
return;
// 已取消,狀態均不顯示
if ( != "Y" && != "R")
return;
// 選修的,未到取消報名截止期限,可取消
if ( == "Y")
{
if (.AddDays(-) > DateTime.UtcNow.AddHours(8).Date)
{
cell.FindControl("btn取消報名").Visible = true;
}
else
{
lt狀態.Text += "<div style=\"color:red\">已超過取消報名截止期限</div>";
}
}
// 尚未報名
if ( == "S")
{
}
}
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
// 處理報名動作
if (e.CommandName == "取消報名")
{
// 1. 寫一筆報名紀錄
int = DAC.GetInt32(e.CommandArgument);
Dao課程報名.(UserId, , UserId);
// 2. 發送報名確認郵件
List values = Dao訓練課程企劃.SelectOne();
string = Dao員工.Get電子郵件(UserId);
string = Dao員工.Get員工姓名(UserId);
if (values.Count > 0)
{
= new ();
.Context = this.Context;
.(, , values[0].,
values[0]., values[0].);
}
GridView1.DataBind();
}
}
}
}
@@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.Forms.
{
public partial class
{
/// <summary>
/// ds選課 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource ds選課;
/// <summary>
/// GridView1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.GridView GridView1;
}
}