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,24 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Complete.aspx.cs" Inherits="Education.MobileSurvey.Complete" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>滿意度調查 - 填寫完成</title>
<link rel="stylesheet" type="text/css" href="MobileSurvey.css" />
</head>
<body>
<form id="form1" runat="server">
<div class="mobile-container">
<div class="mobile-content" style="padding-top: 60px;">
<div class="complete-icon">&#10003;</div>
<div class="complete-text">填寫完畢!</div>
<div class="complete-text" style="font-size: 20px;">感謝您!</div>
<div class="complete-sub">您的滿意度調查表已成功送出。</div>
<asp:LinkButton ID="btnBack" runat="server" CssClass="btn btn-primary mb-10" OnClick="btnBack_Click" Text="返回問卷列表" />
<asp:LinkButton ID="btnLogout" runat="server" CssClass="btn btn-secondary" OnClick="btnLogout_Click" Text="登出" />
</div>
</div>
</form>
</body>
</html>
@@ -0,0 +1,29 @@
using System;
using System.Web.Security;
using WebLib;
namespace Education.MobileSurvey
{
public partial class Complete : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session[PublicVariable.UserId] == null || string.IsNullOrEmpty(Session[PublicVariable.UserId].ToString()))
{
Response.Redirect("Login.aspx");
}
}
protected void btnBack_Click(object sender, EventArgs e)
{
Response.Redirect("SurveyList.aspx");
}
protected void btnLogout_Click(object sender, EventArgs e)
{
Session.Clear();
FormsAuthentication.SignOut();
Response.Redirect("Login.aspx");
}
}
}
@@ -0,0 +1,44 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.MobileSurvey
{
public partial class Complete
{
/// <summary>
/// form1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// btnBack 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnBack;
/// <summary>
/// btnLogout 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnLogout;
}
}
@@ -0,0 +1,38 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Education.MobileSurvey.Login" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>滿意度調查 - 行動版登入</title>
<link rel="stylesheet" type="text/css" href="MobileSurvey.css" />
</head>
<body>
<form id="form1" runat="server">
<div class="mobile-container">
<div class="mobile-content">
<div class="login-logo">
<asp:Image ID="imgLogo" runat="server" ImageUrl="~/picture/Default/logo_ty.png" />
</div>
<div class="login-title">
<asp:Label ID="lbSystemName" runat="server"></asp:Label>
</div>
<div class="form-group">
<label for="txtUserId">使用者代號</label>
<asp:TextBox ID="txtUserId" runat="server" MaxLength="10" Font-Bold="true"></asp:TextBox>
</div>
<div class="form-group">
<label for="txtPassword">登入密碼</label>
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" MaxLength="10" Font-Bold="true"></asp:TextBox>
</div>
<div class="mt-20">
<asp:LinkButton ID="btnLogin" runat="server" CssClass="btn btn-primary" OnClick="btnLogin_Click" Text="登入" />
</div>
<div class="mt-10 text-center">
<asp:Label ID="lbErrMsg" runat="server" CssClass="error-message" EnableViewState="false"></asp:Label>
</div>
</div>
</div>
</form>
</body>
</html>
@@ -0,0 +1,51 @@
using System;
using System.Web.Security;
namespace Education.MobileSurvey
{
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
lbSystemName.Text = PublicVariable.SystemName + " - 行動版";
if (!IsPostBack)
{
if (Session[PublicVariable.UserId] != null && !string.IsNullOrEmpty(Session[PublicVariable.UserId].ToString()))
{
Response.Redirect("SurveyList.aspx");
}
}
}
protected void btnLogin_Click(object sender, EventArgs e)
{
lbErrMsg.Text = "";
if (string.IsNullOrEmpty(txtUserId.Text))
{
lbErrMsg.Text = "請輸入使用者代號!";
return;
}
LoginBPSN login = new LoginBPSN();
login.UserId = txtUserId.Text;
login.Password = txtPassword.Text;
if (login.GetResult())
{
Session[PublicVariable.UserId] = txtUserId.Text;
Session[PublicVariable.UserName] = login.UserName;
Session[PublicVariable.IsManager] = false;
Session[PublicVariable.IsWorker] = false;
Session[PublicVariable.IsBackend] = false;
FormsAuthentication.SetAuthCookie(txtUserId.Text, false);
Response.Redirect("SurveyList.aspx");
}
else
{
lbErrMsg.Text = login.ErrorMessage;
}
}
}
}
@@ -0,0 +1,80 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.MobileSurvey
{
public partial class Login
{
/// <summary>
/// form1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// imgLogo 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Image imgLogo;
/// <summary>
/// lbSystemName 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbSystemName;
/// <summary>
/// txtUserId 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtUserId;
/// <summary>
/// txtPassword 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPassword;
/// <summary>
/// btnLogin 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnLogin;
/// <summary>
/// lbErrMsg 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbErrMsg;
}
}
@@ -0,0 +1,135 @@
* { box-sizing: border-box; }
body {
font-family: "Microsoft JhengHei", Arial, Helvetica, sans-serif;
margin: 0; padding: 0;
background: #f0f2f5;
font-size: 16px;
-webkit-text-size-adjust: 100%;
}
.mobile-container {
max-width: 480px;
margin: 0 auto;
background: #fff;
min-height: 100vh;
position: relative;
}
.mobile-header {
background: #007ACC;
color: white;
padding: 12px 16px;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
font-weight: bold;
position: sticky;
top: 0;
z-index: 10;
}
.mobile-header a, .mobile-header .header-link {
color: white;
text-decoration: none;
font-size: 14px;
font-weight: normal;
background: none;
border: none;
cursor: pointer;
padding: 4px 8px;
}
.mobile-content {
padding: 16px;
}
.login-logo { text-align: center; padding: 40px 0 20px; }
.login-logo img { max-width: 200px; }
.login-title {
text-align: center; font-size: 22px; font-weight: bold;
color: #333; margin-bottom: 30px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
display: block; margin-bottom: 6px;
color: #555; font-size: 14px;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
width: 100%; padding: 12px;
border: 1px solid #ccc; border-radius: 6px;
font-size: 16px; outline: none;
}
.form-group input:focus, .form-group textarea:focus {
border-color: #007ACC;
}
.form-group .required::after {
content: " *"; color: #dc3545;
}
.btn {
display: block; width: 100%;
padding: 14px; border: none; border-radius: 6px;
font-size: 18px; font-weight: bold;
cursor: pointer; text-align: center; text-decoration: none;
}
.btn-primary { background: #007ACC; color: white; }
.btn-success { background: #28a745; color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-outline {
background: transparent; border: 2px solid #007ACC; color: #007ACC;
}
.btn-danger { background: #dc3545; color: white; }
.btn:active { opacity: 0.8; }
.card {
background: #fff; border: 1px solid #e0e0e0;
border-radius: 8px; padding: 16px;
margin-bottom: 12px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.card-title { font-size: 16px; font-weight: bold; color: #333; margin-bottom: 8px; }
.card-subtitle { font-size: 14px; color: #888; margin-bottom: 12px; }
.card-btn { margin-top: 8px; }
.radio-group { margin-bottom: 24px; }
.radio-group .question-text {
font-weight: bold; margin-bottom: 8px; color: #333;
}
.radio-group .question-text .required-mark {
color: #dc3545;
}
.radio-group table { width: 100%; border-collapse: collapse; }
.radio-group table tr { display: block; margin-bottom: 6px; }
.radio-group table td {
display: block; width: 100%;
padding: 12px 16px;
border: 1px solid #ddd; border-radius: 6px;
background: #fafafa; cursor: pointer;
}
.radio-group table td label {
display: inline; cursor: pointer;
font-size: 16px; padding-left: 4px;
}
.radio-group table td input[type="radio"] {
width: 20px; height: 20px; vertical-align: middle;
margin-right: 8px; cursor: pointer;
}
.section-title {
font-weight: bold; font-size: 17px; color: #007ACC;
margin: 24px 0 12px; padding-bottom: 6px;
border-bottom: 2px solid #007ACC;
}
.user-info {
padding: 10px 16px; background: #e8f4fd;
font-size: 14px; color: #333;
border-bottom: 1px solid #d0e8f5;
}
.error-message { color: #dc3545; font-size: 14px; margin-top: 4px; }
.complete-icon { text-align: center; font-size: 80px; color: #28a745; padding: 60px 0 20px; }
.complete-text { text-align: center; font-size: 24px; font-weight: bold; color: #333; margin-bottom: 8px; }
.complete-sub { text-align: center; font-size: 16px; color: #666; margin-bottom: 40px; }
.empty-state { text-align: center; padding: 60px 20px; color: #888; font-size: 16px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }
.space-between { display: flex; justify-content: space-between; align-items: center; }
display: none;
}
@@ -0,0 +1,154 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SurveyForm.aspx.cs" Inherits="Education.MobileSurvey.SurveyForm" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>滿意度調查 - 填寫問卷</title>
<link rel="stylesheet" type="text/css" href="MobileSurvey.css" />
</head>
<body>
<form id="form1" runat="server">
<asp:HiddenField ID="hf學員" runat="server" />
<asp:HiddenField ID="hf課程編號" runat="server" />
<div class="mobile-container">
<div class="mobile-header">
<span>填寫滿意度調查</span>
<asp:LinkButton ID="btnBack" runat="server" CssClass="header-link" OnClick="btnBack_Click" Text="返回" />
</div>
<div class="mobile-content">
<div class="card" style="background: #f8fbff;">
<div class="card-title">
<asp:Label ID="lb課程企劃" runat="server"></asp:Label>
</div>
<div class="card-subtitle">
學員:<asp:Label ID="lb學員" runat="server"></asp:Label>
</div>
</div>
<asp:DataList ID="DataList1" runat="server" OnItemCreated="DataList1_ItemCreated" OnItemDataBound="DataList1_ItemDataBound" Width="100%" EnableViewState="true">
<ItemTemplate>
<div class="section-title">
<asp:HiddenField ID="hf課程序號" runat="server" Value='<%# Bind("課程序號") %>' />
<asp:Label ID="lb課程名稱" runat="server"
Text='<%# String.Format("課程 {0}{1}", Eval("節次"), Eval("課程名稱")) %>'></asp:Label>
</div>
<div class="radio-group">
<div class="question-text">1.課程的實用性 <span class="required-mark">*</span></div>
<asp:RadioButtonList ID="rbl1" runat="server" RepeatDirection="Vertical" CssClass="mobile-radio">
<asp:ListItem Text="非常滿意" Value="5"></asp:ListItem>
<asp:ListItem Text="滿意" Value="4"></asp:ListItem>
<asp:ListItem Text="普通" Value="3"></asp:ListItem>
<asp:ListItem Text="不滿意" Value="2"></asp:ListItem>
<asp:ListItem Text="非常不滿意" Value="1"></asp:ListItem>
</asp:RadioButtonList>
</div>
<div class="radio-group">
<div class="question-text">2.講師的授課方式 <span class="required-mark">*</span></div>
<asp:RadioButtonList ID="rbl2" runat="server" RepeatDirection="Vertical" CssClass="mobile-radio">
<asp:ListItem Text="非常滿意" Value="5"></asp:ListItem>
<asp:ListItem Text="滿意" Value="4"></asp:ListItem>
<asp:ListItem Text="普通" Value="3"></asp:ListItem>
<asp:ListItem Text="不滿意" Value="2"></asp:ListItem>
<asp:ListItem Text="非常不滿意" Value="1"></asp:ListItem>
</asp:RadioButtonList>
</div>
<div class="radio-group">
<div class="question-text">3.講師的專業知識 <span class="required-mark">*</span></div>
<asp:RadioButtonList ID="rbl3" runat="server" RepeatDirection="Vertical" CssClass="mobile-radio">
<asp:ListItem Text="非常滿意" Value="5"></asp:ListItem>
<asp:ListItem Text="滿意" Value="4"></asp:ListItem>
<asp:ListItem Text="普通" Value="3"></asp:ListItem>
<asp:ListItem Text="不滿意" Value="2"></asp:ListItem>
<asp:ListItem Text="非常不滿意" Value="1"></asp:ListItem>
</asp:RadioButtonList>
</div>
<div class="radio-group">
<div class="question-text">4.課程時數安排 <span class="required-mark">*</span></div>
<asp:RadioButtonList ID="rbl4" runat="server" RepeatDirection="Vertical" CssClass="mobile-radio">
<asp:ListItem Text="非常滿意" Value="5"></asp:ListItem>
<asp:ListItem Text="滿意" Value="4"></asp:ListItem>
<asp:ListItem Text="普通" Value="3"></asp:ListItem>
<asp:ListItem Text="不滿意" Value="2"></asp:ListItem>
<asp:ListItem Text="非常不滿意" Value="1"></asp:ListItem>
</asp:RadioButtonList>
</div>
</ItemTemplate>
<FooterTemplate>
<div class="section-title">其它評價</div>
<div class="radio-group">
<div class="question-text">1.行政服務品質 <span class="required-mark">*</span></div>
<asp:RadioButtonList ID="rbl1" runat="server" RepeatDirection="Vertical" CssClass="mobile-radio">
<asp:ListItem Text="非常滿意" Value="5"></asp:ListItem>
<asp:ListItem Text="滿意" Value="4"></asp:ListItem>
<asp:ListItem Text="普通" Value="3"></asp:ListItem>
<asp:ListItem Text="不滿意" Value="2"></asp:ListItem>
<asp:ListItem Text="非常不滿意" Value="1"></asp:ListItem>
</asp:RadioButtonList>
</div>
<div class="radio-group">
<div class="question-text">2.餐點及茶飲 <span class="required-mark">*</span></div>
<asp:RadioButtonList ID="rbl2" runat="server" RepeatDirection="Vertical" CssClass="mobile-radio">
<asp:ListItem Text="非常滿意" Value="5"></asp:ListItem>
<asp:ListItem Text="滿意" Value="4"></asp:ListItem>
<asp:ListItem Text="普通" Value="3"></asp:ListItem>
<asp:ListItem Text="不滿意" Value="2"></asp:ListItem>
<asp:ListItem Text="非常不滿意" Value="1"></asp:ListItem>
</asp:RadioButtonList>
</div>
<div class="radio-group">
<div class="question-text">3.場地滿意度 <span class="required-mark">*</span></div>
<asp:RadioButtonList ID="rbl3" runat="server" RepeatDirection="Vertical" CssClass="mobile-radio">
<asp:ListItem Text="非常滿意" Value="5"></asp:ListItem>
<asp:ListItem Text="滿意" Value="4"></asp:ListItem>
<asp:ListItem Text="普通" Value="3"></asp:ListItem>
<asp:ListItem Text="不滿意" Value="2"></asp:ListItem>
<asp:ListItem Text="非常不滿意" Value="1"></asp:ListItem>
</asp:RadioButtonList>
</div>
<div class="radio-group">
<div class="question-text">4.對整體活動表現 <span class="required-mark">*</span></div>
<asp:RadioButtonList ID="rbl4" runat="server" RepeatDirection="Vertical" CssClass="mobile-radio">
<asp:ListItem Text="非常滿意" Value="5"></asp:ListItem>
<asp:ListItem Text="滿意" Value="4"></asp:ListItem>
<asp:ListItem Text="普通" Value="3"></asp:ListItem>
<asp:ListItem Text="不滿意" Value="2"></asp:ListItem>
<asp:ListItem Text="非常不滿意" Value="1"></asp:ListItem>
</asp:RadioButtonList>
</div>
</FooterTemplate>
</asp:DataList>
<div class="section-title">建議與心得</div>
<div class="form-group">
<label>針對未來相關課程,煩請提供建議以做為我們後續課程之規劃。</label>
<asp:TextBox ID="txt建議" runat="server" TextMode="MultiLine" Rows="5" Style="width: 100%;"></asp:TextBox>
</div>
<div class="form-group">
<label class="required">上課心得摘要(200字~500字內)</label>
<asp:TextBox ID="txt心得" runat="server" TextMode="MultiLine" Rows="5" Style="width: 100%;"></asp:TextBox>
</div>
<div class="mt-20">
<asp:LinkButton ID="btnSave" runat="server" CssClass="btn btn-primary" OnClick="btnSave_Click" Text="確定儲存" />
</div>
<div class="mt-10">
<asp:Label ID="lbMessage" runat="server" CssClass="error-message" EnableViewState="false"></asp:Label>
</div>
</div>
</div>
</form>
<script>
document.addEventListener('DOMContentLoaded', function() {
var tds = document.querySelectorAll('.radio-group table td');
for (var i = 0; i < tds.length; i++) {
tds[i].addEventListener('click', function(e) {
if (e.target.tagName === 'INPUT' || e.target.tagName === 'LABEL') return;
var inp = this.querySelector('input[type="radio"]');
if (inp) inp.checked = true;
});
}
});
</script>
</body>
</html>
@@ -0,0 +1,195 @@
using System;
using System.Data.Common;
using System.Web;
using System.Web.UI.WebControls;
using WebLib;
namespace Education.MobileSurvey
{
public partial class SurveyForm : System.Web.UI.Page
{
private DAC_滿意度調查 Dao滿意度調查;
private DAC_心得報告 Dao心得報告;
private DAC_訓練課程內容 Dao訓練課程內容;
private DAC_訓練課程企劃 Dao訓練課程企劃;
private DAC_滿意度調查講師 Dao滿意度調查講師;
private DAC_滿意度調查課程企劃 Dao滿意度調查課程企劃;
private DataListItem footerItem;
private int ID;
private string ID;
protected void Page_Load(object sender, EventArgs e)
{
if (Session[PublicVariable.UserId] == null || string.IsNullOrEmpty(Session[PublicVariable.UserId].ToString()))
{
Response.Redirect("Login.aspx");
return;
}
DbConnection conn = DAC.NewConnection();
Dao滿意度調查 = new DAC_滿意度調查(conn);
Dao心得報告 = new DAC_心得報告(conn);
Dao訓練課程內容 = new DAC_訓練課程內容(conn);
Dao訓練課程企劃 = new DAC_訓練課程企劃(conn);
Dao滿意度調查講師 = new DAC_滿意度調查講師(conn);
Dao滿意度調查課程企劃 = new DAC_滿意度調查課程企劃(conn);
hf課程編號.Value = Request["course"];
hf學員.Value = Request["student"];
ID = DAC.GetInt32(hf課程編號.Value);
ID = hf學員.Value;
if (string.IsNullOrEmpty(hf課程編號.Value) || string.IsNullOrEmpty(hf學員.Value))
{
lbMessage.Text = "參數錯誤,請從問卷列表重新進入。";
btnSave.Visible = false;
return;
}
if (!IsPostBack)
{
List d1 = Dao訓練課程企劃.SelectOne(ID);
if (d1.Count > 0)
{
lb課程企劃.Text = string.Format("{0} {1}", d1[0]., d1[0].);
}
lb學員.Text = string.Format("{0} {1}", ID, Get員工姓名(ID));
List d = Dao心得報告.Select(false, ID, ID);
if (d.Count > 0)
{
txt心得.Text = d[0].;
txt建議.Text = d[0].;
}
else
{
txt心得.Text = "";
txt建議.Text = "";
}
List courses = Dao訓練課程內容.SelectBy課程企劃(ID);
DataList1.DataSource = courses;
DataList1.DataBind();
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (!CheckRequired())
{
lbMessage.Text = "尚有項目未填寫完整,請填寫完整再儲存!";
ClientShowMessage("尚有項目未填寫完整,請填寫完整再儲存!");
return;
}
foreach (DataListItem item in DataList1.Items)
{
int = DAC.GetInt32((item.FindControl("hf課程序號") as HiddenField).Value);
RadioButtonList rbl1 = item.FindControl("rbl1") as RadioButtonList;
RadioButtonList rbl2 = item.FindControl("rbl2") as RadioButtonList;
RadioButtonList rbl3 = item.FindControl("rbl3") as RadioButtonList;
RadioButtonList rbl4 = item.FindControl("rbl4") as RadioButtonList;
Dao滿意度調查.Update(ID, ID, , 1, DAC.GetInt32(rbl1.SelectedValue), ID);
Dao滿意度調查.Update(ID, ID, , 2, DAC.GetInt32(rbl2.SelectedValue), ID);
Dao滿意度調查.Update(ID, ID, , 3, DAC.GetInt32(rbl3.SelectedValue), ID);
Dao滿意度調查.Update(ID, ID, , 4, DAC.GetInt32(rbl4.SelectedValue), ID);
Dao滿意度調查講師.Update(ID, ID, , ID);
}
RadioButtonList frbl1 = footerItem.FindControl("rbl1") as RadioButtonList;
RadioButtonList frbl2 = footerItem.FindControl("rbl2") as RadioButtonList;
RadioButtonList frbl3 = footerItem.FindControl("rbl3") as RadioButtonList;
RadioButtonList frbl4 = footerItem.FindControl("rbl4") as RadioButtonList;
Dao滿意度調查.Update(ID, ID, 0, 1, DAC.GetInt32(frbl1.SelectedValue), ID);
Dao滿意度調查.Update(ID, ID, 0, 2, DAC.GetInt32(frbl2.SelectedValue), ID);
Dao滿意度調查.Update(ID, ID, 0, 3, DAC.GetInt32(frbl3.SelectedValue), ID);
Dao滿意度調查.Update(ID, ID, 0, 4, DAC.GetInt32(frbl4.SelectedValue), ID);
Dao滿意度調查課程企劃.Update(ID, ID, ID);
Dao心得報告.Update(ID, ID, txt建議.Text, txt心得.Text, ID);
Response.Redirect("Complete.aspx");
}
protected void DataList1_ItemCreated(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Footer)
{
footerItem = e.Item;
}
}
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem ||
e.Item.ItemType == ListItemType.Footer)
{
RadioButtonList rbl1 = e.Item.FindControl("rbl1") as RadioButtonList;
RadioButtonList rbl2 = e.Item.FindControl("rbl2") as RadioButtonList;
RadioButtonList rbl3 = e.Item.FindControl("rbl3") as RadioButtonList;
RadioButtonList rbl4 = e.Item.FindControl("rbl4") as RadioButtonList;
int = 0;
if (e.Item.ItemType != ListItemType.Footer)
= DAC.GetInt32((e.Item.FindControl("hf課程序號") as HiddenField).Value);
滿調List d1 = Dao滿意度調查.SelectOne(ID, ID, , 1);
滿調List d2 = Dao滿意度調查.SelectOne(ID, ID, , 2);
滿調List d3 = Dao滿意度調查.SelectOne(ID, ID, , 3);
滿調List d4 = Dao滿意度調查.SelectOne(ID, ID, , 4);
if (d1.Count > 0 && !string.IsNullOrEmpty(DAC.GetString(d1[0].)))
rbl1.SelectedValue = DAC.GetString(d1[0].);
if (d2.Count > 0 && !string.IsNullOrEmpty(DAC.GetString(d2[0].)))
rbl2.SelectedValue = DAC.GetString(d2[0].);
if (d3.Count > 0 && !string.IsNullOrEmpty(DAC.GetString(d3[0].)))
rbl3.SelectedValue = DAC.GetString(d3[0].);
if (d4.Count > 0 && !string.IsNullOrEmpty(DAC.GetString(d4[0].)))
rbl4.SelectedValue = DAC.GetString(d4[0].);
}
}
private bool CheckRequired()
{
foreach (DataListItem item in DataList1.Items)
{
RadioButtonList rbl1 = item.FindControl("rbl1") as RadioButtonList;
RadioButtonList rbl2 = item.FindControl("rbl2") as RadioButtonList;
RadioButtonList rbl3 = item.FindControl("rbl3") as RadioButtonList;
RadioButtonList rbl4 = item.FindControl("rbl4") as RadioButtonList;
if (rbl1 != null && string.IsNullOrEmpty(rbl1.SelectedValue))
return false;
if (rbl2 != null && string.IsNullOrEmpty(rbl2.SelectedValue))
return false;
if (rbl3 != null && string.IsNullOrEmpty(rbl3.SelectedValue))
return false;
if (rbl4 != null && string.IsNullOrEmpty(rbl4.SelectedValue))
return false;
}
return true;
}
private string Get員工姓名(string ID)
{
DAC_BPSN dao = new DAC_BPSN(DAC.NewConnection());
return dao.Get員工姓名(ID);
}
private void ClientShowMessage(string message)
{
ClientScript.RegisterStartupScript(Page.GetType(), "msg",
string.Format("alert(\"{0}\");", message), true);
}
protected void btnBack_Click(object sender, EventArgs e)
{
Response.Redirect("SurveyList.aspx");
}
}
}
@@ -0,0 +1,116 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.MobileSurvey
{
public partial class SurveyForm
{
/// <summary>
/// form1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// hf學員 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hf學員;
/// <summary>
/// hf課程編號 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hf課程編號;
/// <summary>
/// btnBack 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnBack;
/// <summary>
/// lb課程企劃 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb課程企劃;
/// <summary>
/// lb學員 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lb學員;
/// <summary>
/// DataList1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.DataList DataList1;
/// <summary>
/// txt建議 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt建議;
/// <summary>
/// txt心得 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txt心得;
/// <summary>
/// btnSave 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnSave;
/// <summary>
/// lbMessage 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbMessage;
}
}
@@ -0,0 +1,49 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SurveyList.aspx.cs" Inherits="Education.MobileSurvey.SurveyList" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>滿意度調查 - 問卷列表</title>
<link rel="stylesheet" type="text/css" href="MobileSurvey.css" />
</head>
<body>
<form id="form1" runat="server">
<div class="mobile-container">
<div class="mobile-header">
<span>滿意度調查</span>
<asp:LinkButton ID="btnLogout" runat="server" CssClass="header-link" OnClick="btnLogout_Click" Text="登出" />
</div>
<div class="user-info">
<asp:Literal ID="ltUserInfo" runat="server"></asp:Literal>
</div>
<div class="mobile-content">
<asp:Repeater ID="rptSurveyList" runat="server" OnItemCommand="rptSurveyList_ItemCommand">
<ItemTemplate>
<div class="card">
<div class="card-title">
<asp:Literal ID="lt訓練名稱" runat="server"
Text='<%# Eval("訓練名稱") %>'></asp:Literal>
</div>
<div class="card-subtitle">
<asp:Literal ID="ltDate" runat="server"
Text='<%# Eval("訓練日期", "{0:yyyy-MM-dd}") + (Eval("訓練日期迄") != DBNull.Value && Eval("訓練日期迄").ToString() != "" ? " ~ " + Eval("訓練日期迄", "{0:yyyy-MM-dd}") : "") %>'>
</asp:Literal>
</div>
<asp:LinkButton ID="btnFill" runat="server" CssClass="btn btn-success card-btn"
CommandName="Fill" CommandArgument='<%# Eval("訓練課程編號") + "|" + Eval("學員編號") %>'
Text="填寫問卷" />
</div>
</ItemTemplate>
</asp:Repeater>
<asp:Panel ID="pnlEmpty" runat="server" Visible="false" CssClass="empty-state">
目前沒有需要填寫的問卷<br /><br />
<asp:LinkButton ID="btnRefresh" runat="server" CssClass="btn btn-outline" OnClick="btnRefresh_Click" Text="重新整理" />
</asp:Panel>
<asp:Label ID="lbMessage" runat="server" CssClass="error-message" EnableViewState="false"></asp:Label>
</div>
</div>
</form>
</body>
</html>
@@ -0,0 +1,70 @@
using System;
using System.Data;
using System.Web.Security;
using WebLib;
namespace Education.MobileSurvey
{
public partial class SurveyList : System.Web.UI.Page
{
private DAC_課程報名 Dao課程報名;
protected void Page_Load(object sender, EventArgs e)
{
if (Session[PublicVariable.UserId] == null || string.IsNullOrEmpty(Session[PublicVariable.UserId].ToString()))
{
Response.Redirect("Login.aspx");
return;
}
Dao課程報名 = new DAC_課程報名(DAC.NewConnection());
if (!IsPostBack)
{
string ID = Session[PublicVariable.UserId].ToString();
string = DAC.GetString(Session[PublicVariable.UserName]);
ltUserInfo.Text = "學員:" + ID + " " + ;
LoadSurveyList();
}
}
private void LoadSurveyList()
{
string ID = Session[PublicVariable.UserId].ToString();
DataTable dt = Dao課程報名.Select選課紀錄(ID, false, false, true, true);
if (dt != null)
{
DataView dv = dt.DefaultView;
dv.RowFilter = "填寫數 = 0";
DataTable dtFiltered = dv.ToTable();
rptSurveyList.DataSource = dtFiltered;
rptSurveyList.DataBind();
pnlEmpty.Visible = (dtFiltered.Rows.Count == 0);
}
}
protected void rptSurveyList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
{
if (e.CommandName == "Fill")
{
string[] args = e.CommandArgument.ToString().Split('|');
string courseId = args[0];
string studentId = args[1];
Response.Redirect("SurveyForm.aspx?course=" + courseId + "&student=" + studentId);
}
}
protected void btnLogout_Click(object sender, EventArgs e)
{
Session.Clear();
FormsAuthentication.SignOut();
Response.Redirect("Login.aspx");
}
protected void btnRefresh_Click(object sender, EventArgs e)
{
LoadSurveyList();
}
}
}
@@ -0,0 +1,80 @@
//------------------------------------------------------------------------------
// <自動產生>
// 這段程式碼是由工具產生的。
//
// 變更這個檔案可能會導致不正確的行為,而且如果已重新產生
// 程式碼,則會遺失變更。
// </自動產生>
//------------------------------------------------------------------------------
namespace Education.MobileSurvey
{
public partial class SurveyList
{
/// <summary>
/// form1 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// btnLogout 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnLogout;
/// <summary>
/// ltUserInfo 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltUserInfo;
/// <summary>
/// rptSurveyList 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Repeater rptSurveyList;
/// <summary>
/// btnRefresh 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton btnRefresh;
/// <summary>
/// pnlEmpty 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Panel pnlEmpty;
/// <summary>
/// lbMessage 控制項。
/// </summary>
/// <remarks>
/// 自動產生的欄位。
/// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbMessage;
}
}
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<defaultDocument enabled="true">
<files>
<clear />
<add value="Login.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>