Page 128 - ระบบสารสนเทศเพื่อการบริหารจัดการเอกสารอิเล็กทรอนิกส์ (e-Document)
P. 128
ห้องสมุดกรมพัฒนาที่ดิน
ค- 15
lblDolY2.Text = ddl.createDDLY("ddlDolY2", 2018, 2021,
Request.Form["ddlDolY2"], "na", "--ปี--", false);
lblDolD3.Text = ddl.createDDLD("ddlDolD3",
Request.Form["ddlDolD3"], "na", "--วัน--", false);
lblDolM3.Text = ddl.createDDLM("ddlDolM3",
Request.Form["ddlDolM3"], "na", "--เดือน--", false);
lblDolY3.Text = ddl.createDDLY("ddlDolY3", 2018, 2021,
Request.Form["ddlDolY3"], "na", "--ปี--", false);
lblDolD4.Text = ddl.createDDLD("ddlDolD4",
Request.Form["ddlDolD4"], "na", "--วัน--", false);
lblDolM4.Text = ddl.createDDLM("ddlDolM4",
Request.Form["ddlDolM4"], "na", "--เดือน--", false);
lblDolY4.Text = ddl.createDDLY("ddlDolY4", 2018, 2021,
Request.Form["ddlDolY4"], "na", "--ปี--", false);
}//สร้าง DropDownList หน่วยงาน
string sSql = "SELECT BureauID AS ID, Bureau AS Value FROM Bureau";
lblBureau.Text = ddl.createDDL("ddlBureau", sSql, "ID", "Value",
Request.Form["ddlBureau"], "na", "---ทุกหน่วยงาน---", false);
if (!IsPostBack)
{
GridView1.Visible = true;
sSql = "";
DateTime dt = new DateTime();
dt = DateTime.Today;
string YMD1 = (dt.Year * 10000 + dt.Month * 100 +
0).ToString();
string YMD2 = (dt.Year * 10000 + dt.Month * 100 +
31).ToString();
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 GroupList.Member =
N'" + sBureau + "'";
sSql += " AND Letter.Letter_RecDate >= N'" + YMD1 + "' AND
Letter.Letter_RecDate <= N'" + YMD2 + "'";
sSql += " AND (Letter.Letter_Status = N'1')) Order By
Letter.Letter_RecDate desc";
DBLetter.SelectCommand = sSql;
Session["SQL"] = sSql;
DBLetter.DataBind();
DbMgt table = new DbMgt(str);
MyDataSet ds = new MyDataSet(table.exReader(sSql));
string sSql1 = "SELECT Bureau FROM BureauIntra WHERE BureauID =
N'" + sBureau + "'";