Page 130 - ระบบสารสนเทศเพื่อการบริหารจัดการเอกสารอิเล็กทรอนิกส์ (e-Document)
P. 130
ห้องสมุดกรมพัฒนาที่ดิน
ค- 17
}
if (Request.Form["ddlDolD4"] == "na")
{
Response.Write(ut.alert("ระบุวันที่สิ้นสุด"));
return;
}
if (Request.Form["ddlDolM4"] == "na")
{
Response.Write(ut.alert("ระบุเดือนสิ้นสุด"));
return;
}
if (Request.Form["ddlDolY4"] == "na")
{
Response.Write(ut.alert("ระบุปีสิ้นสุด"));
return;
}
string YMD1 = Request.Form["ddlDolY"] + Request.Form["ddlDolM"] +
Request.Form["ddlDolD"];
string YMD2 = Request.Form["ddlDolY2"] + Request.Form["ddlDolM2"] +
Request.Form["ddlDolD2"];
string YMD3 = Request.Form["ddlDolY3"] + Request.Form["ddlDolM3"] +
Request.Form["ddlDolD3"];
string YMD4 = Request.Form["ddlDolY4"] + Request.Form["ddlDolM4"] +
Request.Form["ddlDolD4"];
string sSql = "";
sSql += "SELECT DISTINCT Letter.Letter_YMD, Letter.Letter_RecDate,
Letter.Letter_No, Letter.Letter_Number, Letter.Letter_Title, RIGHT
(Letter.Letter_YMD, 2) + '/' + SUBSTRING(Letter.Letter_YMD, 5, 2) + '/' +
CONVERT (varchar(4), CONVERT (INT, LEFT (Letter.Letter_YMD, 4)) + 543) AS
DMY, RIGHT (Letter.Letter_RecDate, 2) + '/' +
SUBSTRING(Letter.Letter_RecDate, 5, 2) + '/' + CONVERT (varchar(4), CONVERT
(INT, LEFT (Letter.Letter_RecDate, 4)) + 543) AS DMY_INPUT,
Letter.Letter_Other, Letter.Letter_Filename, Bureau.Bureau AS Expr1,
Piority.PriName, Letter.Letter_Permission, Letter.Letter_Status FROM Letter
INNER JOIN Bureau ON Letter.Letter_Bureau = Bureau.BureauID INNER JOIN
Piority ON Letter.Letter_Priority = Piority.PriID LEFT OUTER JOIN GroupList
ON Letter.Letter_Permission = GroupList.GroupID";
sSql += " WHERE ";
sSql += "(NOT (Letter.Letter_No IS NULL) AND (Letter.Letter_Status
= N'1') AND GroupList.Member = N'" + sBureau + "'";
if (txtLetterNumSe.Text != "")
sSql += " AND Letter.Letter_Number LIKE '%" +
txtLetterNumSe.Text + "%'";
if (txtLetterTitleSe.Text != "")
sSql += " AND Letter.Letter_Title LIKE '%" +
txtLetterTitleSe.Text + "%'";
if (Request.Form["ddlBureau"] != "na")
sSql += " AND Bureau.BureauID = '" + Request.Form["ddlBureau"]
+ "'";
if (SignDate.Checked)
{