Page 158 - ระบบสารสนเทศเพื่อการบริหารจัดการเอกสารอิเล็กทรอนิกส์ (e-Document)
P. 158
ห้องสมุดกรมพัฒนาที่ดิน
ค- 45
public partial class Promote : System.Web.UI.Page
{
string str =
ConfigurationManager.ConnectionStrings["SqlCon"].ConnectionString;
Utilities ut = new Utilities();
protected void Page_Load(object sender, EventArgs e)
{
lbl01.Visible = false;
FormDDL ddl = new FormDDL(str);
if (!IsPostBack)
{
lbl01.Visible = true;
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, "", "", false);
lblDolM.Text = ddl.createDDLM("ddlDolM", sM, "", "", false);
lblDolY.Text = ddl.createDDLY("ddlDolY", 2018, 2030, sY, "",
"", false);
lblDolD2.Text = ddl.createDDLD("ddlDolD2", sD, "", "", false);
lblDolM2.Text = ddl.createDDLM("ddlDolM2", sM, "", "", false);
lblDolY2.Text = ddl.createDDLY("ddlDolY2", 2018, 2030, sY, "",
"", 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", 2018, 2030,
Request.Form["ddlDolY"], "na", "--ปี--", false);
lblDolD2.Text = ddl.createDDLD("ddlDolD2",
Request.Form["ddlDolD2"], "na", "--วัน--", false);
lblDolM2.Text = ddl.createDDLM("ddlDolM2",
Request.Form["ddlDolM2"], "na", "--เดือน--", false);
lblDolY2.Text = ddl.createDDLY("ddlDolY2", 2018, 2030,
Request.Form["ddlDolY2"], "na", "--ปี--", false);
}
if (!IsPostBack)
{
GridView1.Visible = true;
string sSql = "";
sSql += "SELECT Promote.Promote_No, Promote.Promote_Number,
Promote.Promote_Title, RIGHT(Promote.Promote_YMD, 2) + '/' +
SUBSTRING(Promote.Promote_YMD, 5, 2) + '/' + CONVERT(varchar(4), CONVERT
(INT, LEFT(Promote.Promote_YMD, 4)) + 543) AS DMY ,
Promote.Promote_Priority, Promote.Promote_Bureau, Promote.Promote_Filename,
Piority.PriName ";
sSql += "FROM Promote INNER JOIN Piority ON
Promote.Promote_Priority = Piority.PriID ";