76 lines
3.6 KiB
C#
76 lines
3.6 KiB
C#
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.檢視UC
|
|
{
|
|
public partial class 訓練檢討報告View : UserControlBase
|
|
{
|
|
int 課程企劃ID = 0;
|
|
|
|
public override void DataBind()
|
|
{
|
|
base.DataBind();
|
|
|
|
課程企劃ID = DAC.GetInt32(單號);
|
|
ds訓練檢討報告.SelectParameters["訓練課程企劃編號"].DefaultValue = 單號;
|
|
FormView1.DataBind();
|
|
}
|
|
|
|
protected void ds訓練檢討報告_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
|
|
{
|
|
e.ObjectInstance = new DAC_訓練檢討報告(ParentPage.conn);
|
|
}
|
|
|
|
protected void FormView1_DataBound(object sender, EventArgs e)
|
|
{
|
|
if (FormView1.CurrentMode == FormViewMode.ReadOnly && FormView1.FindControl("lb學員出席率") != null)
|
|
{
|
|
FindControl<Label>(FormView1, "lb學員出席率").Text = String.Format("{0:##0.00}%", Dao課程報名.Get出席率(課程企劃ID));
|
|
|
|
DAC_課程經費 Dao課程經費 = new DAC_課程經費(ParentPage.conn);
|
|
FindControl<Label>(FormView1, "lb訓練經費").Text = String.Format("{0:###,###,##0}", Dao課程經費.Get經費合計(課程企劃ID));
|
|
|
|
DAC_滿意度調查課程企劃 Dao滿意度調查課程企劃 = new DAC_滿意度調查課程企劃(ParentPage.conn);
|
|
DataTable d1 = Dao滿意度調查課程企劃.Select滿意度統計(課程企劃ID);
|
|
|
|
if (d1.Rows.Count > 0)
|
|
{
|
|
int 回收數 = DAC.GetInt32(d1.Rows[0]["回收數"]);
|
|
DAC_學員出席 Dao學員出席 = new DAC_學員出席(ParentPage.conn);
|
|
// int 參與人數 = Dao學員出席.Get參與人數(課程企劃ID);
|
|
int 參與人數 = Dao課程報名.Get報名人數(課程企劃ID);
|
|
|
|
FindControl<Label>(FormView1, "lb行政滿意度").Text = String.Format("{0:##0.00}", d1.Rows[0]["行政滿意度"]);
|
|
FindControl<Label>(FormView1, "lb餐點滿意度").Text = String.Format("{0:##0.00}", d1.Rows[0]["餐點滿意度"]);
|
|
FindControl<Label>(FormView1, "lb場地滿意度").Text = String.Format("{0:##0.00}", d1.Rows[0]["場地滿意度"]);
|
|
FindControl<Label>(FormView1, "lb整體滿意度").Text = String.Format("{0:##0.00}", d1.Rows[0]["整體滿意度"]);
|
|
FindControl<Label>(FormView1, "lb參與人數").Text = String.Format("{0}", 參與人數);
|
|
FindControl<Label>(FormView1, "lb回收數").Text = String.Format("{0}", 回收數);
|
|
FindControl<Label>(FormView1, "lb回收率").Text = 參與人數 > 0 ? String.Format("{0:##0.00}", DAC.GetDecimal(回收數) / DAC.GetDecimal(參與人數) * 100) : "--";
|
|
}
|
|
else
|
|
{
|
|
FindControl<Label>(FormView1, "lb行政滿意度").Text = "";
|
|
FindControl<Label>(FormView1, "lb餐點滿意度").Text = "";
|
|
FindControl<Label>(FormView1, "lb場地滿意度").Text = "";
|
|
FindControl<Label>(FormView1, "lb整體滿意度").Text = "";
|
|
FindControl<Label>(FormView1, "lb參與人數").Text = "";
|
|
FindControl<Label>(FormView1, "lb回收數").Text = "";
|
|
FindControl<Label>(FormView1, "lb回收率").Text = "";
|
|
}
|
|
|
|
DAC_滿意度調查講師 Dao滿意度調查講師 = new DAC_滿意度調查講師(ParentPage.conn);
|
|
(FormView1.FindControl("gv講師滿意度") as GridView).DataSource = Dao滿意度調查講師.Select滿意度統計(課程企劃ID);
|
|
(FormView1.FindControl("gv講師滿意度") as GridView).DataBind();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|