72 lines
1.8 KiB
C#
72 lines
1.8 KiB
C#
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 DAC_數位課程觀看紀錄 Dao數位課程觀看紀錄;
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
FunctionName = "數位課程訓練對象";
|
|
|
|
Dao數位課程觀看紀錄 = new DAC_數位課程觀看紀錄(conn);
|
|
|
|
if (IsPostBack)
|
|
{
|
|
GridView1.DataBind();
|
|
}
|
|
}
|
|
|
|
protected void btnSearch員工_Click(object sender, EventArgs e)
|
|
{
|
|
GridView1.DataBind();
|
|
}
|
|
|
|
protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
|
|
{
|
|
switch (e.CommandName)
|
|
{
|
|
case "Add":
|
|
Dao數位課程觀看紀錄.報名(DAC.GetInt32(e.CommandArgument), DAC.GetString(GridView1.SelectedValue), UserId);
|
|
GridView2.DataBind();
|
|
break;
|
|
case "Remove":
|
|
Dao數位課程觀看紀錄.取消報名(DAC.GetInt32(e.CommandArgument), DAC.GetString(GridView1.SelectedValue));
|
|
GridView2.DataBind();
|
|
break;
|
|
}
|
|
}
|
|
|
|
protected void GridView1_DataBound(object sender, EventArgs e)
|
|
{
|
|
if (GridView1.Rows.Count > 0)
|
|
{
|
|
Panel1.Visible = true;
|
|
if (GridView1.SelectedIndex == -1)
|
|
GridView1.SelectedIndex = 0;
|
|
GridView1_SelectedIndexChanged(sender, e);
|
|
}
|
|
else
|
|
Panel1.Visible = false;
|
|
}
|
|
|
|
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
if (GridView1.SelectedIndex != -1)
|
|
{
|
|
Panel2.Visible = true;
|
|
GridView2.DataBind();
|
|
}
|
|
else
|
|
Panel2.Visible = false;
|
|
}
|
|
|
|
}
|
|
} |