Page 149 - ระบบสารสนเทศเพื่อการบริหารจัดการเอกสารอิเล็กทรอนิกส์ (e-Document)
P. 149
ห้องสมุดกรมพัฒนาที่ดิน
ค- 36
sSql = "SELECT BureauID AS ID, Bureau AS Value FROM Bureau";
lblBureau.Text = ddl.createDDL("ddlBureau", sSql, "ID", "Value",
ds.showFieldValue("Letter_Bureau", 0), "", "", true);
if (ds.showFieldValue("Letter_Bureau", 0) == "9999")
{
txtOtherOff.Visible = true;
txtOtherOff.Text = ds.showFieldValue("Letter_Other", 0);
}
else
{
txtOtherOff.Visible = false;
txtOtherOff.Text = "";
}
sSql = "SELECT PriID AS ID, PriName AS Value FROM Piority";
lblPiority.Text = ddl.createDDL("ddlPiority", sSql, "ID", "Value",
ds.showFieldValue("Letter_Priority", 0), "", "", false);
sSql = "SELECT GroupID AS ID, GroupName AS Value FROM Permission
WHERE (GroupActive = N'yes')";
lblPermission.Text = ddl.createDDL("ddlPermission", sSql, "ID",
"Value", ds.showFieldValue("Letter_Permission", 0), "", "", false);
lblFile.Text = "<a href='Letter/" +
ds.showFieldValue("Letter_Filename", 0) + "' target='_blank'>เรียกดูเอกสาร</a>";
sTmp = ds.showFieldValue("Letter_Status", 0);
if (sTmp == "1")
cbStatus.Checked = true;
else
cbStatus.Checked = false;
}
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
sNo = Request.QueryString["No"];
DbMgt table = new DbMgt(str);
string sSqll = "SELECT Bureau FROM BureauIntra WHERE BureauID = N'"
+ sBureau + "'";
MyDataSet ds = new MyDataSet(table.exReader(sSqll));
lblsBureau.Text = "หน่วยงาน :" + ds.showFieldValue("Bureau", 0);
string sSql;
if (sUsername == "admin")
{
sSql = "SELECT COUNT(*) FROM Letter WHERE (Letter_No = " + sNo
+ ")";
}