chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore - 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user