51 lines
1.3 KiB
C#
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 "";
|
|
}
|
|
}
|
|
} |