Page 143 - ระบบสารสนเทศเพื่อการบริหารจัดการเอกสารอิเล็กทรอนิกส์ (e-Document)
P. 143
ห้องสมุดกรมพัฒนาที่ดิน
ค- 30
//Session
string sUsername;
string sBureau;
string sPromote;
string sDeputy;
string sLetter;
protected void Page_Load(object sender, EventArgs e)
{
#region Check Session
if (Session["Username"] == null || Session["Bureau"] == null ||
Session["Promote"] == null || Session["Deputy"] == null ||
Session["Letter"] == null)
{
Response.Redirect("Login.aspx");
}
sUsername = Session["Username"].ToString();
sBureau = Session["Bureau"].ToString();
sPromote = Session["Promote"].ToString();
sDeputy = Session["Deputy"].ToString();
sLetter = Session["Letter"].ToString();
#endregion
FormDDL ddl = new FormDDL(str);
if (!IsPostBack)
{
string sToday = ut.CurrentYYYYMMDD();
string sD = sToday.Substring(6, 2);
string sM = sToday.Substring(4, 2);
string sY = sToday.Substring(0, 4);
lblDolD.Text = ddl.createDDLD("ddlDolD", sD, "na", "--วัน--",
false);
lblDolM.Text = ddl.createDDLM("ddlDolM", sM, "na", "--เดือน--",
false);
lblDolY.Text = ddl.createDDLY("ddlDolY", 2017, 2030, sY, "na",
"--ปี--", false);
}
else
{
lblDolD.Text = ddl.createDDLD("ddlDolD",
Request.Form["ddlDolD"], "na", "--วัน--", false);
lblDolM.Text = ddl.createDDLM("ddlDolM",
Request.Form["ddlDolM"], "na", "--เดือน--", false);
lblDolY.Text = ddl.createDDLY("ddlDolY", 2017, 2030,
Request.Form["ddlDolY"], "na", "--ปี--", false);
}
string sSql = "SELECT BureauID AS ID, Bureau AS Value FROM Bureau";
lblBureau.Text = ddl.createDDL("ddlBureau", sSql, "ID", "Value",
Request.Form["ddlBureau"], "na", "---หน่วยงาน---", true);
string sSql1 = "SELECT PriID AS ID, PriName AS Value FROM Piority";
lblPiority.Text = ddl.createDDL("ddlPiority", sSql1, "ID", "Value",
Request.Form["ddlPiority"], "na", "--ชั้นความเร็ว--", false);
string sSql11 = "SELECT GroupID AS ID, GroupName AS Value,
GroupActive FROM Permission WHERE (GroupActive = N'yes') ";