Page 148 - ระบบสารสนเทศเพื่อการบริหารจัดการเอกสารอิเล็กทรอนิกส์ (e-Document)
P. 148
ห้องสมุดกรมพัฒนาที่ดิน
ค- 35
อ้างอิงไฟล์ EditLetter.aspx.cs ดังนี้
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
// เพิ่มเป็นพิเศษ
using System.IO;
public partial class EditLetter : System.Web.UI.Page
{
string str =
ConfigurationManager.ConnectionStrings["SqlCon"].ConnectionString;
Utilities ut = new Utilities();
string sUsername;
string sBureau;
string sPromote;
string sDeputy;
string sLetter;
string sNo;
protected void showData(string sNo)
{
DbMgt table = new DbMgt(str);
MyDataSet ds;
string sSql;
string sTmp;
string sY;
string sM;
string sD;
FormDDL ddl = new FormDDL(str);
sSql = "SELECT Letter_No, Letter_Number, Letter_Title, Letter_YMD,
Letter_Priority, Letter_Bureau, Letter_Filename, Letter_Status,
Letter_Other, Letter_Permission FROM Letter WHERE (Letter_No = " + sNo +
")";
ds = new MyDataSet(table.exReader(sSql));
txtLetterNum.Text = ds.showFieldValue("Letter_Number", 0);
txtLetterTitle.Text = ds.showFieldValue("Letter_Title", 0);
sTmp = ds.showFieldValue("Letter_YMD", 0);
sY = sTmp.Substring(0, 4);
sM = sTmp.Substring(4, 2);
sD = sTmp.Substring(6, 2);
lblDolD.Text = ddl.createDDLD("ddlDolD", sD, "", "", false);
lblDolM.Text = ddl.createDDLM("ddlDolM", sM, "", "", false);
lblDolY.Text = ddl.createDDLY("ddlDolY", 2018, 2030, sY, "", "",
false);