Example #1
0
    public static Dictionary <string, object> SetValueDataRecorded(string _page, string _id)
    {
        Dictionary <string, object> _valueDataRecordedResult = new Dictionary <string, object>();
        Dictionary <string, object> _dataRecorded            = new Dictionary <string, object>();
        DataSet _ds = new DataSet();

        if (_page.Equals(PAGE_DOWNLOADREGISTRATIONFORMSTUDENTRECORDS_MAIN))
        {
            _ds = HCSDB.GetHCSStudentRecords(_id);
        }

        if (_ds.Tables.Count > 0)
        {
            if (_page.Equals(PAGE_DOWNLOADREGISTRATIONFORMSTUDENTRECORDS_MAIN))
            {
                _dataRecorded = HCSStaffDownloadRegistrationFormUtil.StudentRecordsUtil.SetValueDataRecorded(_dataRecorded, _ds);
            }
        }

        _ds.Dispose();

        if (_page.Equals(PAGE_DOWNLOADREGISTRATIONFORMSTUDENTRECORDS_MAIN))
        {
            _valueDataRecordedResult.Add(("DataRecorded" + SUBJECT_SECTION_DOWNLOADREGISTRATIONFORMSTUDENTRECORDS), _dataRecorded);
        }

        return(_valueDataRecordedResult);
    }
Example #2
0
    public static Dictionary <string, object> GetLogin(string _page, string _id)
    {
        Dictionary <string, object> _loginResult = GetInfoLogin();
        DataSet _ds          = new DataSet();
        int     _systemError = Util.DBUtil.ChkSystemPermissionStudent(_loginResult);
        int     _cookieError = 0;
        int     _userError   = 0;
        string  _personId    = _loginResult["PersonId"].ToString();
        string  _nationality = _loginResult["Nationality"].ToString();

        if (!String.IsNullOrEmpty(_personId))
        {
            _ds = HCSDB.GetStudentRecords(_personId);
        }

        _systemError = (_systemError.Equals(4) ? 0 : _systemError);
        _systemError = (_systemError.Equals(5) ? 0 : _systemError);
        _systemError = (_systemError.Equals(0) ? (_ds.Tables[0].Rows.Count > 0 ? 0 : 6) : _systemError);
        _systemError = (_systemError.Equals(0) ? (_nationality.Equals("TH") ? 0 : 6) : _systemError);

        switch (_systemError)
        {
        case 1:
            _cookieError = 1;
            break;

        case 2:
            _userError = 1;
            break;

        case 6:
            _userError = 2;
            break;

        case 3:
            _userError = 4;
            break;

            /*
             * case 4:
             *  _userError = 5;
             *  break;
             * case 5:
             *  _userError = 6;
             *  break;
             */
        }

        _loginResult["CookieError"] = _cookieError.ToString();
        _loginResult.Add("UserError", _userError.ToString());

        return(_loginResult);
    }
Example #3
0
    public static Dictionary <string, object> GetInfoLogin(string _page, string _id)
    {
        Dictionary <string, object> _finServiceLoginResult = FinServiceLogin.GetFinServiceLogin(FinServiceLogin.USERTYPE_STUDENT, "e-Profile");
        Dictionary <string, object> _loginResult           = new Dictionary <string, object>();
        int    _systemError = Util.DBUtil.ChkSystemPermissionStudent(_finServiceLoginResult);
        int    _cookieError = 0;
        int    _userError   = 0;
        string _personId    = _finServiceLoginResult["PersonID"].ToString();
        string _studentId   = _finServiceLoginResult["StudentID"].ToString();

        if (_systemError.Equals(0))
        {
            _systemError = (!String.IsNullOrEmpty(_personId) ? (HCSDB.GetHCSStudentRecords(_personId).Tables[0].Rows.Count > 0 ? 0 : 6) : 6);
        }

        switch (_systemError)
        {
        case 1:
            _cookieError = 1;
            break;

        case 2:
            _userError = 1;
            break;

        case 6:
            _userError = 2;
            break;

        case 3:
            _userError = 4;
            break;

        case 4:
            _userError = 5;
            break;

        case 5:
            _userError = 6;
            break;
        }

        _loginResult.Add("CookieError", _cookieError.ToString());
        _loginResult.Add("UserError", _userError.ToString());
        _loginResult.Add("PersonId", _personId);
        _loginResult.Add("StudentId", _studentId);

        return(_loginResult);
    }
Example #4
0
    public static Dictionary <string, object> GetTermServiceHCSConsentRegistration(string _studentId)
    {
        Dictionary <string, object> _termServiceResult = new Dictionary <string, object>();
        DataSet _ds = new DataSet();
        string  _termServiceType           = String.Empty;
        string  _termServiceDate           = String.Empty;
        string  _termServiceTime           = String.Empty;
        string  _termServiceStatus         = String.Empty;
        string  _termServiceNote           = String.Empty;
        string  _termServiceHospitalNameTH = String.Empty;
        string  _termServiceHospitalNameEN = String.Empty;


        if (!String.IsNullOrEmpty(_studentId))
        {
            _ds = HCSDB.GetTermServiceHCSConsentRegistration(_studentId);

            if (_ds.Tables[0].Rows.Count > 0)
            {
                DataRow _dr = _ds.Tables[0].Rows[0];

                if (_dr["termTypeHCSConsentRegistration"].ToString().Equals("HCS_CONSENT_REGISTRATION"))
                {
                    _termServiceType           = _dr["termTypeHCSConsentRegistration"].ToString();
                    _termServiceDate           = _dr["cTermDateHCSConsentRegistration"].ToString();
                    _termServiceTime           = _dr["cTermTimeHCSConsentRegistration"].ToString();
                    _termServiceStatus         = _dr["termStatusHCSConsentRegistration"].ToString();
                    _termServiceNote           = _dr["noteHCSConsentRegistration"].ToString();
                    _termServiceHospitalNameTH = _dr["termHCSConsentRegistrationHospitalNameTH"].ToString();
                    _termServiceHospitalNameEN = _dr["termHCSConsentRegistrationHospitalNameEN"].ToString();
                }
            }
        }

        _ds.Dispose();

        _termServiceResult.Add("TermServiceTypeHCSConsentRegistration", _termServiceType);
        _termServiceResult.Add("TermServiceDateHCSConsentRegistration", _termServiceDate);
        _termServiceResult.Add("TermServiceTimeHCSConsentRegistration", _termServiceTime);
        _termServiceResult.Add("TermServiceStatusHCSConsentRegistration", _termServiceStatus);
        _termServiceResult.Add("TermServiceNoteHCSConsentRegistration", _termServiceNote);
        _termServiceResult.Add("TermServiceHospitalNameTHHCSConsentRegistration", _termServiceHospitalNameTH);
        _termServiceResult.Add("TermServiceHospitalNameENHCSConsentRegistration", _termServiceHospitalNameEN);

        return(_termServiceResult);
    }
Example #5
0
    public static Dictionary <string, object> GetTermServiceHCSConsentOOCA(string _studentId)
    {
        Dictionary <string, object> _termServiceResult = new Dictionary <string, object>();
        DataSet _ds = new DataSet();
        string  _termServiceType   = String.Empty;
        string  _termServiceDate   = String.Empty;
        string  _termServiceTime   = String.Empty;
        string  _termServiceStatus = String.Empty;

        if (!String.IsNullOrEmpty(_studentId))
        {
            _ds = HCSDB.GetTermServiceHCSConsentOOCA(_studentId);

            if (_ds.Tables[0].Rows.Count > 0)
            {
                DataRow _dr = _ds.Tables[0].Rows[0];

                if (_dr["termTypeHCSConsentOOCA"].ToString().Equals("HCS_CONSENT_OOCA"))
                {
                    _termServiceType   = _dr["termTypeHCSConsentOOCA"].ToString();
                    _termServiceDate   = _dr["cTermDateHCSConsentOOCA"].ToString();
                    _termServiceTime   = _dr["cTermTimeHCSConsentOOCA"].ToString();
                    _termServiceStatus = _dr["termStatusHCSConsentOOCA"].ToString();
                }
            }
        }

        _ds.Dispose();

        _termServiceResult.Add("TermServiceTypeHCSConsentOOCA", _termServiceType);
        _termServiceResult.Add("TermServiceDateHCSConsentOOCA", _termServiceDate);
        _termServiceResult.Add("TermServiceTimeHCSConsentOOCA", _termServiceTime);
        _termServiceResult.Add("TermServiceStatusHCSConsentOOCA", _termServiceStatus);

        return(_termServiceResult);
    }
            public static StringBuilder GetMain()
            {
                StringBuilder _html        = new StringBuilder();
                StringBuilder _contentTemp = new StringBuilder();
                Dictionary <string, Dictionary <string, object> > _contentFrmColumn = new Dictionary <string, Dictionary <string, object> >();

                Dictionary <string, object>[] _contentFrmColumnDetail = new Dictionary <string, object> [3];
                Dictionary <string, object>   _paramSearch            = new Dictionary <string, object>();
                DataSet _ds         = new DataSet();
                string  _fontTHSize = "f10";
                string  _fontENSize = "f10";
                int     _i          = 0;

                _contentTemp.Clear();
                _contentTemp.AppendFormat("<div class='lang lang-th font-family-th black light {0}'></div>", _fontTHSize);
                _contentTemp.AppendFormat("<div class='lang lang-en font-family-en black light {0}'></div>", _fontENSize);

                _contentFrmColumnDetail[_i] = new Dictionary <string, object>();
                _contentFrmColumnDetail[_i].Add("ID", (_idSectionDialog + "-workedstatus"));
                _contentFrmColumnDetail[_i].Add("HighLight", false);
                _contentFrmColumnDetail[_i].Add("TitleTH", "สถานะการทำงานของนักศึกษา");
                _contentFrmColumnDetail[_i].Add("FontSizeTitleTH", _fontTHSize);
                _contentFrmColumnDetail[_i].Add("TitleEN", "Worked Status");
                _contentFrmColumnDetail[_i].Add("FontSizeTitleEN", _fontENSize);
                _contentFrmColumnDetail[_i].Add("DiscriptionTH", "");
                _contentFrmColumnDetail[_i].Add("DiscriptionEN", "");
                _contentFrmColumnDetail[_i].Add("InputContentPaddingDown", false);
                _contentFrmColumnDetail[_i].Add("InputContent", _contentTemp.ToString());
                _contentFrmColumnDetail[_i].Add("Require", false);
                _contentFrmColumnDetail[_i].Add("LastRow", false);
                _contentFrmColumn.Add("WorkedStatus", _contentFrmColumnDetail[_i]);
                _i++;

                _paramSearch.Clear();
                _paramSearch.Add("WorkedStatus", "Y");
                _paramSearch.Add("CancelledStatus", "N");

                _ds = HCSDB.GetListWelfare(_paramSearch);

                _contentTemp.Clear();

                foreach (DataRow _dr1 in _ds.Tables[0].Rows)
                {
                    _contentTemp.AppendLine("<div class='radio-row'>");
                    _contentTemp.AppendLine("   <ul>");
                    _contentTemp.AppendLine("       <li class='radio-col input-col'>");
                    _contentTemp.AppendFormat("         <input class='inputradio' type='radio' name='{0}-welfare' value='{1}' />", _idSectionDialog, _dr1["id"]);
                    _contentTemp.AppendLine("       </li>");
                    _contentTemp.AppendLine("       <li class='radio-col label-col'>");
                    _contentTemp.AppendFormat("         <div class='lang lang-th font-family-th black light {0}'>{1}</div>", _fontTHSize, _dr1["nameTH"]);
                    _contentTemp.AppendFormat("         <div class='lang lang-en font-family-en black light {0}'>{1}</div>", _fontENSize, _dr1["nameEN"]);
                    _contentTemp.AppendLine("       </li>");
                    _contentTemp.AppendLine("   </ul>");
                    _contentTemp.AppendLine("</div>");
                }

                _ds.Dispose();

                _contentFrmColumnDetail[_i] = new Dictionary <string, object>();
                _contentFrmColumnDetail[_i].Add("ID", (_idSectionDialog + "-welfareworkedstatusy"));
                _contentFrmColumnDetail[_i].Add("HighLight", false);
                _contentFrmColumnDetail[_i].Add("TitleTH", "สวัสดิการจากที่ทำงาน");
                _contentFrmColumnDetail[_i].Add("FontSizeTitleTH", _fontTHSize);
                _contentFrmColumnDetail[_i].Add("TitleEN", "From Welfare to Work");
                _contentFrmColumnDetail[_i].Add("FontSizeTitleEN", _fontENSize);
                _contentFrmColumnDetail[_i].Add("DiscriptionTH", "");
                _contentFrmColumnDetail[_i].Add("DiscriptionEN", "");
                _contentFrmColumnDetail[_i].Add("InputContentPaddingDown", false);
                _contentFrmColumnDetail[_i].Add("InputContent", _contentTemp.ToString());
                _contentFrmColumnDetail[_i].Add("Require", false);
                _contentFrmColumnDetail[_i].Add("LastRow", false);
                _contentFrmColumn.Add("WelfareWorkedStatusY", _contentFrmColumnDetail[_i]);
                _i++;

                _paramSearch.Clear();
                _paramSearch.Add("WorkedStatus", "N");
                _paramSearch.Add("CancelledStatus", "N");

                _ds = HCSDB.GetListWelfare(_paramSearch);

                _contentTemp.Clear();

                foreach (DataRow _dr2 in _ds.Tables[0].Rows)
                {
                    _contentTemp.AppendLine("<div class='radio-row'>");
                    _contentTemp.AppendLine("   <ul>");
                    _contentTemp.AppendLine("       <li class='radio-col input-col'>");
                    _contentTemp.AppendFormat("         <input class='inputradio' type='radio' name='{0}-welfare' value='{1}' />", _idSectionDialog, _dr2["id"]);
                    _contentTemp.AppendLine("       </li>");
                    _contentTemp.AppendLine("       <li class='radio-col label-col'>");
                    _contentTemp.AppendFormat("         <div class='lang lang-th font-family-th black light {0}'>{1}</div>", _fontTHSize, _dr2["nameTH"]);
                    _contentTemp.AppendFormat("         <div class='lang lang-en font-family-en black light {0}'>{1}</div>", _fontENSize, _dr2["nameEN"]);
                    _contentTemp.AppendLine("       </li>");
                    _contentTemp.AppendLine("   </ul>");
                    _contentTemp.AppendLine("</div>");
                }

                _ds.Dispose();

                _contentFrmColumnDetail[_i] = new Dictionary <string, object>();
                _contentFrmColumnDetail[_i].Add("ID", (_idSectionDialog + "-welfareworkedstatusn"));
                _contentFrmColumnDetail[_i].Add("HighLight", false);
                _contentFrmColumnDetail[_i].Add("TitleTH", "ปัจจุบันเบิกค่ารักษาพยาบาลอย่างไร");
                _contentFrmColumnDetail[_i].Add("FontSizeTitleTH", _fontTHSize);
                _contentFrmColumnDetail[_i].Add("TitleEN", "Reimbursement of Medical Expenses");
                _contentFrmColumnDetail[_i].Add("FontSizeTitleEN", _fontENSize);
                _contentFrmColumnDetail[_i].Add("DiscriptionTH", "");
                _contentFrmColumnDetail[_i].Add("DiscriptionEN", "");
                _contentFrmColumnDetail[_i].Add("InputContentPaddingDown", false);
                _contentFrmColumnDetail[_i].Add("InputContent", _contentTemp.ToString());
                _contentFrmColumnDetail[_i].Add("Require", false);
                _contentFrmColumnDetail[_i].Add("LastRow", false);
                _contentFrmColumn.Add("WelfareWorkedStatusN", _contentFrmColumnDetail[_i]);

                _html.AppendFormat("<div class='dialog' id='{0}-panel'>", _idSectionDialog);
                _html.AppendLine("      <div class='panel panel-transparent'>");
                _html.AppendLine("          <div class='panel-body'>");
                _html.AppendLine("              <div class='form horizontal'>");
                _html.AppendLine(HCSUI.GetFrmColumn(_contentFrmColumn["WorkedStatus"]).ToString());
                _html.AppendLine(HCSUI.GetFrmColumn(_contentFrmColumn["WelfareWorkedStatusY"]).ToString());
                _html.AppendLine(HCSUI.GetFrmColumn(_contentFrmColumn["WelfareWorkedStatusN"]).ToString());
                _html.AppendLine("              </div>");
                _html.AppendLine("              <div class='btn-command text-center'>");
                _html.AppendFormat("                <a class='btn btn-block btn-info' id='{0}-buttondownload'>", _idSectionDialog);
                _html.AppendFormat("                    <div class='lang lang-th font-family-th {0} regular'>เริ่มดาวน์โหลด</div>", _fontTHSize);
                _html.AppendFormat("                    <div class='lang lang-en font-family-en {0} regular'>Start Download</div>", _fontENSize);
                _html.AppendLine("                  </a>");
                _html.AppendLine("              </div>");
                _html.AppendLine("          </div>");
                _html.AppendLine("      </div>");
                _html.AppendLine("  </div>");

                return(_html);
            }
Example #7
0
        public static void GetRegisForm(Dictionary <string, object> _dataRecorded)
        {
            string  _formName  = String.Empty;
            string  _address   = String.Empty;
            int     _error     = 0;
            int     _template  = 0;
            int     _i         = 0;
            bool    _download1 = false;
            bool    _download2 = false;
            DataSet _ds        = new DataSet();
            DataRow _dr        = null;

            switch (_dataRecorded["HospitalId"].ToString())
            {
            case "RA":
                _template = 2;
                _formName = "RARegisForm";
                break;

            case "SI":
                _template = 3;
                _formName = "SIRegisForm";
                break;
            }

            _ds = HCSDB.GetHCSRegistrationForm(_formName);

            if (_ds.Tables[0].Rows.Count > 0)
            {
                _dr        = _ds.Tables[0].Rows[0];
                _download1 = (_dr["cancelledStatus"].ToString().Equals("N") ? true : false);
            }

            _ds.Dispose();

            _ds = HCSDB.GetHCSRegistrationForm("KN003Form");

            if (_ds.Tables[0].Rows.Count > 0)
            {
                _dr        = _ds.Tables[0].Rows[0];
                _download2 = (_dr["cancelledStatus"].ToString().Equals("N") ? true : false);
            }

            _ds.Dispose();

            if (_error.Equals(0) && _download1.Equals(true))
            {
                _error = HCSDB.InsertHCSDownloadLog(_dataRecorded["PersonId"].ToString(), _formName, "Student");
            }

            if (_error.Equals(0) && _download2.Equals(true))
            {
                _error = HCSDB.InsertHCSDownloadLog(_dataRecorded["PersonId"].ToString(), "KN003Form", "Student");
            }

            if (_error.Equals(0))
            {
                ExportToPDF _e = new ExportToPDF();
                _e.ExportToPDFConnect(_formName + ".pdf");
                _e.PDFConnectTemplate(_myPDFFormTemplate, "pdf");
                _e.PDFAddTemplate("pdf", 1, 1);

                if (_download1.Equals(true))
                {
                    _e.PDFAddTemplate("pdf", _template, 2);

                    _e.FillForm(_myPDFFontNormal, 11, 0, "วันที่พิมพ์ " + Util.ConvertDateTH(Util.CurrentDate("yyyy/MM/dd")), 18, 565, 100, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (!_dataRecorded["StudentCode"].Equals("XXXXXXX") ? Util.GetBlank(_dataRecorded["StudentCode"].ToString(), "") : ""), 192, 572, 91, 0);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["ProgramNameTH"].ToString(), ""), 180, 555, 106, 23);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["FacultyNameTH"].ToString(), ""), 169, 536, 118, 23);
                    _e.FillForm(_myPDFFontBold, 16, 0, Util.GetFullName(Util.GetBlank(_dataRecorded["TitleInitialsTH"].ToString(), ""), Util.GetBlank(_dataRecorded["TitleFullNameTH"].ToString(), ""), Util.GetBlank(_dataRecorded["FirstName"].ToString(), ""), Util.GetBlank(_dataRecorded["MiddleName"].ToString(), ""), Util.GetBlank(_dataRecorded["LastName"].ToString(), "")), 18, 478, 260, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 1 ? _dataRecorded["IdCard"].ToString().Substring(0, 1) : ""), 23, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 2 ? _dataRecorded["IdCard"].ToString().Substring(1, 1) : ""), 54, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 3 ? _dataRecorded["IdCard"].ToString().Substring(2, 1) : ""), 69, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 4 ? _dataRecorded["IdCard"].ToString().Substring(3, 1) : ""), 84, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 5 ? _dataRecorded["IdCard"].ToString().Substring(4, 1) : ""), 100, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 6 ? _dataRecorded["IdCard"].ToString().Substring(5, 1) : ""), 131, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 7 ? _dataRecorded["IdCard"].ToString().Substring(6, 1) : ""), 147, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 8 ? _dataRecorded["IdCard"].ToString().Substring(7, 1) : ""), 162, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 9 ? _dataRecorded["IdCard"].ToString().Substring(8, 1) : ""), 177, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 10 ? _dataRecorded["IdCard"].ToString().Substring(9, 1) : ""), 193, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 11 ? _dataRecorded["IdCard"].ToString().Substring(10, 1) : ""), 224, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 12 ? _dataRecorded["IdCard"].ToString().Substring(11, 1) : ""), 239, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 16, 0, (Util.GetBlank(_dataRecorded["IdCard"].ToString(), "").Length >= 13 ? _dataRecorded["IdCard"].ToString().Substring(12, 1) : ""), 271, 441, 8, 0);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["BirthDateTH"].ToString(), ""), 72, 416, 87, 0);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["HouseNoPermanentAddress"].ToString(), ""), 56, 385, 48, 0);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["VillageNoPermanentAddress"].ToString(), ""), 123, 385, 27, 0);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["LaneAlleyPermanentAddress"].ToString(), ""), 189, 385, 93, 0);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["RoadPermanentAddress"].ToString(), ""), 33, 370, 90, 0);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["SubDistrictNameTHPermanentAddress"].ToString(), ""), 166, 370, 117, 0);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["DistrictNameTHPermanentAddress"].ToString(), ""), 56, 355, 60, 0);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["ProvinceNameTHPermanentAddress"].ToString(), ""), 141, 355, 56, 0);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["PostalCodePermanentAddress"].ToString(), ""), 238, 355, 45, 0);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["PhoneNumberPermanentAddress"].ToString(), ""), 45, 339, 95, 0);
                    _e.FillForm(_myPDFFontBold, 12, 0, Util.GetBlank(_dataRecorded["MobileNumberPermanentAddress"].ToString(), ""), 185, 339, 97, 0);

                    if (!_dataRecorded["OccupationNameTHFather"].ToString().IndexOf("รับราชการ").Equals(-1) || !_dataRecorded["OccupationNameTHFather"].ToString().IndexOf("พนักงาน / ลูกจ้าง ส่วนราชการ").Equals(-1) ||
                        !_dataRecorded["OccupationNameTHMother"].ToString().IndexOf("รับราชการ").Equals(-1) || !_dataRecorded["OccupationNameTHMother"].ToString().IndexOf("พนักงาน / ลูกจ้าง ส่วนราชการ").Equals(-1) ||
                        !_dataRecorded["OccupationNameTHParent"].ToString().IndexOf("รับราชการ").Equals(-1) || !_dataRecorded["OccupationNameTHParent"].ToString().IndexOf("พนักงาน / ลูกจ้าง ส่วนราชการ").Equals(-1))
                    {
                        _e.FillForm(_myPDFFontBold, 14, 0, "รอเปลี่ยนสิทธิอายุ 20 ปี", 18, 22, 440, 0);
                    }

                    if (!String.IsNullOrEmpty(Util.GetBlank(_dataRecorded["IdCard"].ToString(), "")))
                    {
                        _e.FillForm(_myPDFFontBarcode, 24, 2, "*" + _dataRecorded["IdCard"] + "*", 577, 29, 245, 0);
                    }
                }

                if (_download2.Equals(true))
                {
                    _e.PDFAddTemplate("pdf", 10, 2);

                    _e.FillForm(_myPDFFontBold, 14, 0, Util.GetFullName(Util.GetBlank(_dataRecorded["TitleInitialsTH"].ToString(), ""), Util.GetBlank(_dataRecorded["TitleFullNameTH"].ToString(), ""), Util.GetBlank(_dataRecorded["FirstName"].ToString(), ""), Util.GetBlank(_dataRecorded["MiddleName"].ToString(), ""), Util.GetBlank(_dataRecorded["LastName"].ToString(), "")), 79, 494, 278, 0);
                    _address += (!String.IsNullOrEmpty(Util.GetBlank(_dataRecorded["VillageCurrentAddress"].ToString(), "")) ? ("หมู่บ้าน" + _dataRecorded["VillageCurrentAddress"] + " ") : "");
                    _address += (!String.IsNullOrEmpty(Util.GetBlank(_dataRecorded["HouseNoCurrentAddress"].ToString(), "")) ? ("บ้านเลขที่ " + _dataRecorded["HouseNoCurrentAddress"] + " ") : "");
                    _address += (!String.IsNullOrEmpty(Util.GetBlank(_dataRecorded["VillageNoCurrentAddress"].ToString(), "")) ? ("หมู่ " + _dataRecorded["VillageNoCurrentAddress"]) + " " : "");
                    _address += (!String.IsNullOrEmpty(Util.GetBlank(_dataRecorded["LaneAlleyCurrentAddress"].ToString(), "")) ? ("ซอย " + _dataRecorded["LaneAlleyCurrentAddress"]) : "");
                    _e.FillForm(_myPDFFontBold, 14, 0, _address, 89, 473, 400, 0);

                    _address  = String.Empty;
                    _address += (!String.IsNullOrEmpty(Util.GetBlank(_dataRecorded["RoadCurrentAddress"].ToString(), "")) ? ("ถนน" + _dataRecorded["RoadCurrentAddress"] + " ") : "");
                    _address += (!String.IsNullOrEmpty(Util.GetBlank(_dataRecorded["SubDistrictNameTHCurrentAddress"].ToString(), "")) ? ("ตำบล" + _dataRecorded["SubDistrictNameTHCurrentAddress"]) : "");
                    _e.FillForm(_myPDFFontBold, 14, 0, _address, 99, 453, 258, 0);
                    _e.FillForm(_myPDFFontBold, 14, 0, (!String.IsNullOrEmpty(Util.GetBlank(_dataRecorded["DistrictNameTHCurrentAddress"].ToString(), "")) ? ("อำเภอ" + _dataRecorded["DistrictNameTHCurrentAddress"] + "") : ""), 109, 432, 248, 0);
                    _e.FillForm(_myPDFFontBold, 14, 0, (!String.IsNullOrEmpty(Util.GetBlank(_dataRecorded["ProvinceNameTHCurrentAddress"].ToString(), "")) ? ("จังหวัด" + _dataRecorded["ProvinceNameTHCurrentAddress"] + "") : ""), 119, 412, 238, 0);

                    if (!String.IsNullOrEmpty(Util.GetBlank(_dataRecorded["PostalCodeCurrentAddress"].ToString(), "")))
                    {
                        _e.FillForm(_myPDFFontBold, 14, 0, (_dataRecorded["PostalCodeCurrentAddress"].ToString().Length >= 1 ? _dataRecorded["PostalCodeCurrentAddress"].ToString().Substring(0, 1) : ""), 182, 387, 8, 0);
                        _e.FillForm(_myPDFFontBold, 14, 0, (_dataRecorded["PostalCodeCurrentAddress"].ToString().Length >= 2 ? _dataRecorded["PostalCodeCurrentAddress"].ToString().Substring(1, 1) : ""), 199, 387, 8, 0);
                        _e.FillForm(_myPDFFontBold, 14, 0, (_dataRecorded["PostalCodeCurrentAddress"].ToString().Length >= 3 ? _dataRecorded["PostalCodeCurrentAddress"].ToString().Substring(2, 1) : ""), 216, 387, 8, 0);
                        _e.FillForm(_myPDFFontBold, 14, 0, (_dataRecorded["PostalCodeCurrentAddress"].ToString().Length >= 4 ? _dataRecorded["PostalCodeCurrentAddress"].ToString().Substring(3, 1) : ""), 232, 387, 8, 0);
                        _e.FillForm(_myPDFFontBold, 14, 0, (_dataRecorded["PostalCodeCurrentAddress"].ToString().Length >= 5 ? _dataRecorded["PostalCodeCurrentAddress"].ToString().Substring(4, 1) : ""), 250, 387, 8, 0);
                    }

                    if (!String.IsNullOrEmpty(Util.GetBlank(_dataRecorded["ProgramAddress"].ToString(), "")))
                    {
                        string[] _programAddressArray = _dataRecorded["ProgramAddress"].ToString().Split('&');
                        int      _col = 380;
                        int      _row = 225;

                        for (_i = 0; _i < _programAddressArray.GetLength(0); _i++)
                        {
                            _e.FillForm(_myPDFFontBold, 16, 0, _programAddressArray[_i], _col, _row, 363, 0);
                            _col = _col + 10;
                            _row = _row - 22;
                        }
                    }
                }

                _e.ExportToPdfDisconnect();
            }
        }
            public static StringBuilder GetMain()
            {
                StringBuilder _html        = new StringBuilder();
                StringBuilder _contentTemp = new StringBuilder();
                Dictionary <string, Dictionary <string, object> > _contentFrmColumn = new Dictionary <string, Dictionary <string, object> >();

                Dictionary <string, object>[] _contentFrmColumnDetail = new Dictionary <string, object> [3];
                Dictionary <string, object>   _paramSearch            = new Dictionary <string, object>();
                DataSet _ds         = new DataSet();
                string  _fontTHSize = "f10";
                string  _fontENSize = "f10";
                int     _i          = 0;

                _paramSearch.Clear();
                _paramSearch.Add("ID", "RA, SI");
                _paramSearch.Add("CancelledStatus", "N");

                _ds = HCSDB.GetListHospital(_paramSearch);

                _contentTemp.Clear();

                foreach (DataRow _dr1 in _ds.Tables[0].Rows)
                {
                    _contentTemp.AppendLine("<div class='radio-row'>");
                    _contentTemp.AppendLine("   <ul>");
                    _contentTemp.AppendLine("       <li class='radio-col input-col'>");
                    _contentTemp.AppendFormat("         <input class='inputradio' type='radio' name='{0}-hospital' value='{1}' />", _idSectionDialog, _dr1["id"]);
                    _contentTemp.AppendLine("       </li>");
                    _contentTemp.AppendLine("       <li class='radio-col label-col'>");
                    _contentTemp.AppendFormat("         <div class='lang lang-th font-family-th black light {0}'>{1}</div>", _fontTHSize, _dr1["hospitalNameTH"]);
                    _contentTemp.AppendFormat("         <div class='lang lang-en font-family-en black light {0}'>{1}</div>", _fontENSize, _dr1["hospitalNameEN"]);
                    _contentTemp.AppendLine("       </li>");
                    _contentTemp.AppendLine("   </ul>");
                    _contentTemp.AppendLine("</div>");
                }

                _ds.Dispose();

                _contentFrmColumnDetail[_i] = new Dictionary <string, object>();
                _contentFrmColumnDetail[_i].Add("ID", (_idSectionDialog + "-hospital"));
                _contentFrmColumnDetail[_i].Add("HighLight", false);
                _contentFrmColumnDetail[_i].Add("TitleTH", String.Empty);
                _contentFrmColumnDetail[_i].Add("FontSizeTitleTH", String.Empty);
                _contentFrmColumnDetail[_i].Add("TitleEN", String.Empty);
                _contentFrmColumnDetail[_i].Add("FontSizeTitleEN", String.Empty);
                _contentFrmColumnDetail[_i].Add("DiscriptionTH", String.Empty);
                _contentFrmColumnDetail[_i].Add("DiscriptionEN", String.Empty);
                _contentFrmColumnDetail[_i].Add("InputContentPaddingDown", false);
                _contentFrmColumnDetail[_i].Add("InputContent", _contentTemp.ToString());
                _contentFrmColumnDetail[_i].Add("Require", false);
                _contentFrmColumnDetail[_i].Add("LastRow", false);
                _contentFrmColumn.Add("Hospital", _contentFrmColumnDetail[_i]);

                _html.AppendFormat("<div class='dialog' id='{0}-panel'>", _idSectionDialog);
                _html.AppendLine("      <div class='panel panel-transparent'>");
                _html.AppendLine("          <div class='panel-body'>");
                _html.AppendLine("              <div class='form horizontal'>");
                _html.AppendLine(HCSUI.GetFrmColumn(_contentFrmColumn["Hospital"]).ToString());
                _html.AppendLine("              </div>");
                _html.AppendLine("              <div class='btn-command text-center'>");
                _html.AppendFormat("                <a class='btn btn-block btn-info' id='{0}-buttonsave'>", _idSectionDialog);
                _html.AppendFormat("                    <div class='lang lang-th font-family-th {0} regular'>บันทึก</div>", _fontTHSize);
                _html.AppendFormat("                    <div class='lang lang-en font-family-en {0} regular'>Save</div>", _fontENSize);
                _html.AppendLine("                  </a>");
                _html.AppendLine("              </div>");
                _html.AppendLine("          </div>");
                _html.AppendLine("      </div>");
                _html.AppendLine("  </div>");

                return(_html);
            }