Files
thinkyu/branches/1150807/Forms/組織/職務類別處理.aspx.cs
T
sryang 577060bc78 chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore
- 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
2026-09-10 09:42:37 +08:00

51 lines
1.3 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
{
private DAC_組織類別 Dao組織類別;
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "職務類別處理";
Dao組織類別 = new DAC_組織類別(conn);
if (IsPostBack)
GridView1.DataBind();
else
ddl組織類別.DataBind();
}
protected void dsGrid_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = Dao職務;
}
protected void btnInsert_Click(object sender, EventArgs e)
{
職務 newItem = new 職務();
newItem.職務名稱 = txt職務名稱.Text;
newItem.組織類別ID = ddl組織類別.SelectedItem.Value;
newItem.主管 = cb主管.Value;
newItem.DB_CRUSR = UserId;
Dao職務.InsertOne(newItem);
GridView1.DataBind();
}
protected string Get組織類別名稱(object 組織類別ID)
{
組織類別List d = Dao組織類別.SelectOne(DAC.GetInt32(組織類別ID));
if (d.Count > 0)
return d[0].組織類別名稱;
else
return "";
}
}
}