Page 150 - ระบบสารสนเทศเพื่อการบริหารจัดการเอกสารอิเล็กทรอนิกส์ (e-Document)
P. 150
ห้องสมุดกรมพัฒนาที่ดิน
ค- 37
else
{
sSql = "SELECT COUNT(*) FROM Letter WHERE (Letter_No = " + sNo
+ ") AND (Letter_RecUser = N'" + sUsername + "')";
}
if (table.exScalar(sSql) != "1")
Response.Redirect("Login.aspx");
if (!IsPostBack)
{
showData(sNo);
btnUploadNewFile.Text = "upload ไฟล์ใหม่";
pnlBrowse.Visible = false;
}
else
{
FormDDL ddl = new FormDDL(str);
sSql = "SELECT BureauID AS ID, Bureau AS Value FROM Bureau";
lblBureau.Text = ddl.createDDL("ddlBureau", sSql, "ID",
"Value", Request.Form["ddlBureau"], "", "", true);
if (Request.Form["ddlBureau"] == "9999")
{
txtOtherOff.Visible = true;
}
else
{
txtOtherOff.Visible = false;
}
sSql = "SELECT PriID AS ID, PriName AS Value FROM Piority";
lblPiority.Text = ddl.createDDL("ddlPiority", sSql, "ID",
"Value", Request.Form["ddlPiority"], "", "", false);
sSql = "SELECT GroupID AS ID, GroupName AS Value FROM
Permission WHERE (GroupActive = N'yes')";
lblPermission.Text = ddl.createDDL("ddlPermission", sSql, "ID",
"Value", Request.Form["ddlPermission"], "", "", false);
lblDolD.Text = ddl.createDDLD("ddlDolD",
Request.Form["ddlDolD"], "", "", false);
lblDolM.Text =
ddl.createDDLM("ddlDolM",Request.Form["ddlDolM"], "", "", false);
lblDolY.Text = ddl.createDDLY("ddlDolY", 2018, 2030,
Request.Form["ddlDolY"], "", "", false);
}
}
protected string upload(string sFilename)
{
{
try
{
string[] sValidExt = { ".pdf", ".zip", ".rar" };
string sFolderName = "Letter";
string sAlertInvalidFileType = "กรุณาเลือกไฟล์ชนิด";
string sAlertSuccess = "Upload ไฟล์เรียบร้อยแล้ว";
string sAlertFailure = "เกิดความผิดพลาด ไม่สามารถ Upload ไฟล์ได้";
Boolean bValidExt;