chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore - 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
@@ -0,0 +1,132 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebLib;
|
||||
|
||||
namespace Education.Forms.辦訓狀況
|
||||
{
|
||||
public partial class 滿意度調查表填寫狀況 : FormBase
|
||||
{
|
||||
private DAC_心得報告 Dao心得報告;
|
||||
private DAC_心得報告討論 Dao心得報告討論;
|
||||
private DAC_滿意度調查 Dao滿意度調查;
|
||||
private DAC_訓練課程內容 Dao訓練課程內容;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
FunctionName = "滿意度調查表填寫狀況";
|
||||
Dao心得報告 = new DAC_心得報告(conn);
|
||||
Dao心得報告討論 = new DAC_心得報告討論(conn);
|
||||
Dao滿意度調查 = new DAC_滿意度調查(conn);
|
||||
Dao訓練課程內容 = new DAC_訓練課程內容(conn);
|
||||
|
||||
if (IsPostBack)
|
||||
gv學員.DataBind();
|
||||
|
||||
gv學員.Columns[6].Visible = IsManager;
|
||||
|
||||
RegisterPostbackTrigger(btn匯出滿意度調查);
|
||||
}
|
||||
|
||||
protected void ds已上課_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
|
||||
{
|
||||
e.ObjectInstance = Dao訓練課程企劃;
|
||||
}
|
||||
|
||||
protected void ds計畫_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
|
||||
{
|
||||
e.ObjectInstance = Dao課程報名;
|
||||
}
|
||||
|
||||
protected void ds報名學員_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
|
||||
{
|
||||
e.ObjectInstance = Dao課程報名;
|
||||
}
|
||||
|
||||
protected void btn查詢_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (訓練企劃搜尋.訓練企劃編號 == 0)
|
||||
{
|
||||
Panel1.Visible = false;
|
||||
lbMessage.Text = "請選擇課程企劃";
|
||||
return;
|
||||
}
|
||||
|
||||
Panel1.Visible = true;
|
||||
ddl計畫.DataBind();
|
||||
}
|
||||
|
||||
protected void btn查詢學員_Click(object sender, EventArgs e)
|
||||
{
|
||||
gv學員.DataBind();
|
||||
}
|
||||
|
||||
protected void gv學員_RowCommand(object sender, GridViewCommandEventArgs e)
|
||||
{
|
||||
switch (e.CommandName)
|
||||
{
|
||||
case "上架":
|
||||
Dao心得報告.上架(DAC.GetInt32(e.CommandArgument), UserId);
|
||||
gv學員.DataBind();
|
||||
break;
|
||||
case "下架":
|
||||
Dao心得報告.下架(DAC.GetInt32(e.CommandArgument), UserId);
|
||||
gv學員.DataBind();
|
||||
break;
|
||||
case "Del滿意度":
|
||||
//Eval("學員編號", "{0}") + "|" + Eval("心得報告編號", "{0}")
|
||||
string[] args = e.CommandArgument.ToString().Split('|');
|
||||
if (args.Length > 1)
|
||||
{
|
||||
Dao滿意度調查.Delete(訓練企劃搜尋.訓練企劃編號, args[0]);
|
||||
|
||||
心得報告List d = Dao心得報告.SelectOne(DAC.GetInt32(args[1]));
|
||||
if (d.Count > 0)
|
||||
{
|
||||
Dao心得報告.DeleteOne(d[0]);
|
||||
}
|
||||
}
|
||||
gv學員.DataBind();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected int Get討論數(object 心得報告編號)
|
||||
{
|
||||
return Dao心得報告討論.Select討論數(DAC.GetInt32(心得報告編號), false);
|
||||
}
|
||||
|
||||
protected void btn匯出滿意度調查_Click(object sender, EventArgs e)
|
||||
{
|
||||
var 學員Table = Dao課程報名.Select確定報名學員名單(訓練企劃搜尋.訓練企劃編號);
|
||||
var 課程List = Dao訓練課程內容.SelectBy課程企劃(訓練企劃搜尋.訓練企劃編號);
|
||||
var 滿意度List = Dao滿意度調查.Select(訓練企劃搜尋.訓練企劃編號);
|
||||
var 心得List = Dao心得報告.Select(false, 訓練企劃搜尋.訓練企劃編號, null);
|
||||
|
||||
var 課程滿意度List = 滿意度List
|
||||
.FindAll(x => x.課程序號 != 0)
|
||||
.OrderBy(x => x.課程序號)
|
||||
.ThenBy(x => x.題目編號)
|
||||
.ToList();
|
||||
var 整體滿意度List = 滿意度List
|
||||
.FindAll(x => x.課程序號 == 0)
|
||||
.OrderBy(x => x.題目編號)
|
||||
.ToList();
|
||||
|
||||
var 滿意度匯出 = new Education.Report.滿意度匯出();
|
||||
滿意度匯出.學員Table = 學員Table;
|
||||
滿意度匯出.課程List = 課程List;
|
||||
滿意度匯出.課程滿意度List = 課程滿意度List;
|
||||
滿意度匯出.整體滿意度List = 整體滿意度List;
|
||||
滿意度匯出.心得List = 心得List;
|
||||
|
||||
var ms = 滿意度匯出.DoReport();
|
||||
ResponseWriteStream(ms, String.Format("滿意度-{0}.xls", 訓練企劃搜尋.訓練企劃名稱));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user