コード例 #1
0
    /// <summary>
    /// แก้ไขข้อมูลจากตาราง ABOUTLECTURER
    /// </summary>
    /// <param name="updateData">AboutLecturer Object</param>
    /// <returns>Success</returns>
    public string updateAcademicPosition(AcademicPosition updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        string sql = "Update ABOUTLECTURER Set ACADEMICPOSITIONTHNAME = '" + updateData.AcademicPositionThName + "', ACADEMICPOSITIONENNAME = '" + updateData.AcademicPositionEnName + "' Where ACADEMICPOSITIONCODE = '" + updateData.AcademicPositionCode + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "Success";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "updateAcademicPosition: " + exception;
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }

        return(response);
    }
コード例 #2
0
    /// <summary>
    /// เพิ่มข้อมูลลงตาราง ACADEMICPOSITION
    /// </summary>
    /// <param name="dataInsert">AcademicPosition Object</param>
    /// <returns>Success</returns>
    public string insertAcademicPosition(AcademicPosition dataInsert)
    {
        string response = "";

        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        string sql = "Insert into ACADEMICPOSITION (ACADEMICPOSITIONCODE, ACADEMICPOSITIONTHNAME, ACADEMICPOSITIONENNAME) values ('" + dataInsert.AcademicPositionCode + "','" + dataInsert.AcademicPositionThName + "','" + dataInsert.AcademicPositionEnName + "')";

        oracleObj.InsertCommand = sql;

        try
        {
            if (oracleObj.Insert() == 1)
            {
                response = "Success";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "insertAcademicPosition: " + exception;
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }

        return(response);
    }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("Id,ApplicationUserId,PositionTypeId,FacultyId,UniversityId,CountryId,CityId,ArDescription,EnDescription,IsCurrent,FromYear,ToYear,Indx")] AcademicPosition academicPosition)
        {
            if (ModelState.IsValid)
            {
                _context.Add(academicPosition);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ApplicationUserId"] = _userManager.GetUserId(User);
            ViewData["PositionTypeId"]    = new SelectList(_context.PositionTypes, "Id", "ArPositionName");
            ViewData["CountryId"]         = new SelectList(_context.Countries, "Id", "ArCountryName");
            ViewData["CityId"]            = new SelectList(_context.Cities, "Id", "ArCityName", academicPosition.CityId);
            ViewData["UniversityId"]      = new SelectList(_context.Universities, "Id", "ArUniversityName", academicPosition.UniversityId);
            ViewData["FacultyId"]         = new SelectList(_context.Faculties, "Id", "ArFacultyName", academicPosition.FacultyId);

            return(View(academicPosition));
        }
コード例 #4
0
    /// <summary>
    /// เรียกดูข้อมูลจากตาราง ACADEMICPOSITION
    /// </summary>
    /// <param name="AcademicPositionCode">รหัสตำแหน่งทางวิชาการ</param>
    /// <returns>ข้อมูลจากตาราง ACADEMICPOSITION</returns>
    public AcademicPosition getAcademicPosition(string AcademicPositionCode)
    {
        AcademicPosition data = new AcademicPosition();

        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        oracleObj.SelectCommand = "Select * From ACADEMICPOSITION Where ACADEMICPOSITIONCODE='" + AcademicPositionCode + "'";
        DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty);

        foreach (DataRowView rowData in allData)
        {
            data.AcademicPositionCode   = rowData["ACADEMICPOSITIONCODE"].ToString();
            data.AcademicPositionThName = rowData["ACADEMICPOSITIONTHNAME"].ToString();
            data.AcademicPositionEnName = rowData["ACADEMICPOSITIONENNAME"].ToString();
        }

        return(data);
    }
コード例 #5
0
    /// <summary>
    /// เรียกดูข้อมูลจากตาราง ACADEMICPOSITION
    /// </summary>
    /// <returns>ข้อมูลจากตาราง ACADEMICPOSITION</returns>
    public List <AcademicPosition> getAcademicPosition()
    {
        List <AcademicPosition> data = new List <AcademicPosition>();

        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        oracleObj.SelectCommand = "Select * From ACADEMICPOSITION Order By ACADEMICPOSITIONCODE";
        DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty);

        foreach (DataRowView rowData in allData)
        {
            AcademicPosition row = new AcademicPosition();

            row.AcademicPositionCode   = rowData["ACADEMICPOSITIONCODE"].ToString();
            row.AcademicPositionThName = rowData["ACADEMICPOSITIONTHNAME"].ToString();
            row.AcademicPositionEnName = rowData["ACADEMICPOSITIONENNAME"].ToString();

            data.Add(row);
        }

        return(data);
    }
コード例 #6
0
        public async Task <IActionResult> Edit(int id,
                                               [Bind("Id,ApplicationUserId,PositionTypeId,FacultyId,UniversityId,CountryId,CityId,ArDescription,EnDescription,IsCurrent,FromYear,ToYear,Indx")]
                                               AcademicPosition academicPosition)
        {
            if (id != academicPosition.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(academicPosition);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AcademicPositionExists(academicPosition.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PositionTypeId"] = new SelectList(_context.PositionTypes, "Id", "ArPositionName", academicPosition.PositionTypeId);
            ViewData["CountryId"]      = new SelectList(_context.Countries, "Id", "ArCountryName", academicPosition.CountryId);
            ViewData["CityId"]         = new SelectList(_context.Cities, "Id", "ArCityName", academicPosition.CityId);
            ViewData["UniversityId"]   = new SelectList(_context.Universities.Where(u => u.CountryId == academicPosition.CountryId), "Id", "ArUniversityName", academicPosition.UniversityId);
            ViewData["FacultyId"]      = new SelectList(_context.Faculties.Where(c => c.UniversityId == academicPosition.UniversityId), "Id", "ArFacultyName", academicPosition.FacultyId);
            return(View(academicPosition));
        }
コード例 #7
0
ファイル: detailCurr.aspx.cs プロジェクト: blkwarrior/myGIT
    protected void Page_Load(object sender, EventArgs e)
    {
        CurrCode    = Request.QueryString["CurrCode"];
        YearVersion = Request.QueryString["YearVersion"];

        TQF.Curriculum curriculum    = new TQF.Curriculum().getCurriculum(CurrCode, YearVersion);
        StructurePlan  structurePlan = new StructurePlan().getStructurePlan(CurrCode, YearVersion);

        //Header
        lblTitleFaculty.Text    = new Faculty().getFaculty(curriculum.FacultyCode).Faculty_Thai;
        lblTitleDepartment.Text = "ภาควิชา" + new Department().getDepartment(curriculum.DepartmentCode).Department_Thai;
        string currStatus = "";

        if (curriculum.CurrStatus == "1")
        {
            currStatus = "ใหม่";
        }
        if (curriculum.CurrStatus == "2")
        {
            currStatus = "ปรับปรุง";
        }
        lblTitleCurriculum.Text = curriculum.CurrThName + "<br>" + "(หลักสูตร" + currStatus + " พ.ศ. " + curriculum.YearVersion + ")";

        //Tab 1: ข้อมูลทั่วไป
        lblCURR_CODE.Text             = curriculum.CurrCode;
        lblCURR_THAINAME.Text         = curriculum.CurrThName;
        lblCURR_ENGNAME.Text          = curriculum.CurrEnName;
        lblDEGREE_THAINAME.Text       = new Diploma().getDiploma(curriculum.DiplomaCode).DomainThName;
        lblDEGREE_SHORT_THAINAME.Text = new Diploma().getDiploma(curriculum.DiplomaCode).DomainThShortName;
        lblDEGREE_ENGNAME.Text        = new Diploma().getDiploma(curriculum.DiplomaCode).DomainEnName;
        lblDEGREE_SHORT_ENGNAME.Text  = new Diploma().getDiploma(curriculum.DiplomaCode).DomainEnShortName;
        lblCURR_YEAR.Text             = curriculum.YearVersion;
        lblCURR_FACULTY.Text          = new Faculty().getFaculty(curriculum.FacultyCode).Faculty_Thai;
        lblCURR_DEPARTMENT.Text       = new Department().getDepartment(curriculum.DepartmentCode).Department_Thai;

        string sqlDivisionExtension = "Select * From DIVISIONEXTENSION Where DIVISIONNO='" + curriculum.DivisionCode + "' Order By DIVISIONCODE";
        List <DivisionExtension> divisionExtension = new DivisionExtension().getDivisionExtensionManual(sqlDivisionExtension);

        foreach (DivisionExtension data in divisionExtension)
        {
            lblCURR_MAJOR.Text += new TQF.Division().getDivision(data.DivisionCode).DivisionEnShortName + " " + new TQF.Division().getDivision(data.DivisionCode).DivisionThName + "<BR>";
        }

        string           sqlMajor = "Select * From MAJOR Where CURRCODE='" + CurrCode + "' And YEARVERSION='" + YearVersion + "'";
        List <TQF.Major> major    = new TQF.Major().getMajorManual(sqlMajor);

        foreach (TQF.Major data in major)
        {
            lblCURR_SPEC_FIELD.Text += data.MajorThName + "<BR>";

            //แสดงผลอาจารย์ประจำแขนง (ถ้ามี)
            string html = "";
            html += "<div class=\"row tb-curr-info\">";
            html += "<div class=\"col-sm-4 txt-blue\">";
            html += "<i class=\"icon-append fa fa-user\"></i> ";
            html += "<strong>อาจารย์ประจำแขนง : " + data.MajorThName + "</strong>";
            html += "</div>";
            html += "<div class=\"col-sm-8\">";
            //เรียกข้อมูลอาจารย์ประจำแขนง
            string sqlLecturerMajor = "Select * From ABOUTLECTURER Where CURRCODE='" + CurrCode + "' And YEARVERSION='" + YearVersion + "' And LOADTYPECODE='4' And MAJORCODE='" + data.MajorCode + "'Order By LECTIDENTITY";
            List <AboutLecturer> aboutLecturerMajor = new AboutLecturer().getAboutLecturerManual(sqlLecturerMajor);

            Label lblCURR_LECTURER2 = new Label();
            foreach (AboutLecturer lecturer in aboutLecturerMajor)
            {
                SysUser          sysUser  = new SysUser().getSysUser(lecturer.LectIdentity);
                AcademicPosition position = new AcademicPosition().getAcademicPosition(sysUser.AcademicPositionCode);
                lblCURR_LECTURER2.Text += position.AcademicPositionThName + sysUser.ThName + " " + sysUser.ThSurName + "<BR>";
            }
            html += lblCURR_LECTURER2.Text;
            html += "</div>";
            html += "</div>";

            Label la = new Label();
            la.Text = html;
            placeHTML1.Controls.Add(la);
        }

        lblTOTAL_CREDIT.Text     = structurePlan.TotalCredits + " หน่วยกิต";
        lblSTUDY_YEAR.Text       = curriculum.NumYear + " ปี";
        lblTOTAL_STUDY_YEAR.Text = curriculum.MaxNumYear + " ปี";
        //lblMODI_CURR_CODE.Text = "";
        //lblMODI_CURR_YEAR.Text = "";

        //ความหมาย LOADTYPECODE
        //1	อาจารย์ประจำหลักสูตร
        //2	อาจาร์ผู้ร่วมสอน
        //3	อาจารย์พิเศษ
        //4	อาจารย์ประจำแขนง
        string sqlLecturer = "Select * From ABOUTLECTURER Where CURRCODE='" + CurrCode + "' And YEARVERSION='" + YearVersion + "' And LOADTYPECODE='1' Order By LECTIDENTITY";
        List <AboutLecturer> aboutLecturer = new AboutLecturer().getAboutLecturerManual(sqlLecturer);

        foreach (AboutLecturer data in aboutLecturer)
        {
            SysUser          sysUser  = new SysUser().getSysUser(data.LectIdentity);
            AcademicPosition position = new AcademicPosition().getAcademicPosition(sysUser.AcademicPositionCode);
            lblCURR_LECTURER1.Text += position.AcademicPositionThName + sysUser.ThName + " " + sysUser.ThSurName + "<BR>";
        }

        string sql = "Select * From STRUCTUREPLAN Where CURRCODE='" + CurrCode + "' And YEARVERSION='" + YearVersion + "'";
        List <StructurePlan> dataStructurePlan = new StructurePlan().getStructurePlanManual(sql);

        foreach (StructurePlan data in dataStructurePlan)
        {
            //Tab 2: โครงสร้างหลักสูตร
            htmlGenerateTab2(data.MajorCode, data.CurrFormatCode, data.TotalCredits, data.YearVersion, data.CurrTypeCode);

            //Tab 3: รายวิชาในหลักสูตร
            htmlGenerateTab3(data.MajorCode, data.CurrFormatCode, data.TotalCredits, data.YearVersion, data.CurrTypeCode);

            //Tab 4: แผนการศึกษา
            htmlGenerateTab4(data.MajorCode, data.CurrFormatCode, data.TotalCredits, data.YearVersion, data.CurrTypeCode);
        }
    }
コード例 #8
0
    private void printLecturerForm(string lectuere_id, HttpResponse Response)
    {
        SysUser  sysUserData  = new SysUser().getSysUser(code);
        Sysuser2 sysuserData2 = new Sysuser2().getSysuser2(code);

        string prefix               = new Prefix().getPrefix(sysUserData.TitleNameCode).Prefix_Thai;
        string thai_name            = sysUserData.ThName;
        string thai_surname         = sysUserData.ThSurName;
        string academic_position    = new AcademicPosition().getAcademicPosition(sysUserData.AcademicPositionCode).AcademicPositionThName;
        string nationality          = new Country().getCountry(sysUserData.Nationality).Country_ThaiName;
        string ethnicity            = new Country().getCountry(sysUserData.Ethnicity).Country_ThaiName;
        string religion             = new Religion().getReligion(sysuserData2.ReligionCode).Religion_ThaiName;
        string birth_day            = new TQF.TQFUtility().getThaiBirthDay(sysUserData.BirthDay);
        string nation_id            = sysUserData.IdCode;
        string issue_by             = sysuserData2.IdIssuePlace;
        string issue_date           = new TQF.TQFUtility().getThaiBirthDay(sysuserData2.IdDateIssue);
        string expire_date          = new TQF.TQFUtility().getThaiBirthDay(sysuserData2.IdIssueExpire);
        string license_id           = "";
        string license_issue_by     = "";
        string license_issue_date   = "";
        string license_expire_date  = "";
        string home_address         = sysUserData.HomeNumber;
        string home_moo             = sysUserData.HomeMoo;
        string home_vilage_building = sysUserData.HomeBuilding + " " + sysUserData.HomeVillage;
        string home_soi             = sysUserData.HomeSoi;
        string home_road            = sysUserData.HomeRoad;
        string home_tumbol          = new SubDistrict().getSUBDistrict(sysUserData.HomeTumbol).SubDistrict_ThaiName;
        string home_amphur          = new District().getDistrict(sysUserData.HomeAmphur).District_ThaiName;
        string home_provice         = new Province().getProvince(sysUserData.HomeProvince).Province_ThaiName;
        string home_phone           = sysuserData2.Telephone;
        string home_mobile          = sysUserData.MobileNumber;
        string work_address         = sysUserData.OfficeNumber + " " + sysUserData.OfficeName + sysUserData.OfficeMoo + " " + sysUserData.OfficeVillage + " " + sysUserData.OfficeBuilding + " " + sysUserData.OfficeSoi + " " + sysUserData.OfficeRoad + " " + new SubDistrict().getSUBDistrict(sysUserData.OfficeTumbol).SubDistrict_ThaiName + " " + new District().getDistrict(sysUserData.OfficeAmphur).District_ThaiName + " " + new TQF.Province().getProvince(sysUserData.OfficeProvince).ProvinceThai;
        string email = sysUserData.Email;

        List <QualificationDetail> qualificationDetail = new List <QualificationDetail>();
        string sql = "Select * From QUALIFICATIONDETAIL Where LECTIDENTITY='" + code + "' Order by YEAR";

        qualificationDetail = new QualificationDetail().getQualificationDetailManual(sql);

        List <LecturerSholarship> lecturerSholarship = new List <LecturerSholarship>();
        string sql2 = "Select * From LECTURERSHOLARSHIP Where LECTIDENTITY='" + code + "' Order by SCHOLARYEAR";

        lecturerSholarship = new LecturerSholarship().getLecturerSholarshipManual(sql2);


        if (sysuserData2.LicenseId.Length > 0)
        {
            license_id          = sysuserData2.LicenseId;
            license_issue_by    = sysuserData2.LicenseIssuePlace;
            license_issue_date  = new TQF.TQFUtility().getThaiBirthDay(sysuserData2.LicensDateIssue);
            license_expire_date = new TQF.TQFUtility().getThaiBirthDay(sysuserData2.LicenseIssueExpire);
        }


        pdfReport    objPdf       = new pdfReport();
        Document     doc          = new Document(PageSize.A4, 0, 0, 30, 0);
        MemoryStream memoryStream = new MemoryStream();
        PdfWriter    writer       = PdfWriter.GetInstance(doc, memoryStream);

        doc.Open();

        // =============== Page 1 ==========

        PdfPTable tableH = new PdfPTable(3);

        tableH.DefaultCell.Border = 0;
        tableH.DefaultCell.HorizontalAlignment = 1;
        float[] widthsHead = new float[] { 1f, 5f, 1f };
        tableH.SetWidths(widthsHead);

        iTextSharp.text.Image logo = iTextSharp.text.Image.GetInstance(System.Web.HttpContext.Current.Server.MapPath("../img/logo_lecturer_form.png"));
        logo.ScaleAbsolute(80f, 90f);
        PdfPCell cell_logo = new PdfPCell(logo);

        cell_logo.Border = 0;
        cell_logo.HorizontalAlignment = Element.ALIGN_LEFT;
        cell_logo.VerticalAlignment   = 1;
        cell_logo.Rowspan             = 3;

        iTextSharp.text.Image picturer = iTextSharp.text.Image.GetInstance(System.Web.HttpContext.Current.Server.MapPath("../img/pic-1inch.png"));
        picturer.ScaleAbsolute(80f, 90f);
        PdfPCell cell_picturer = new PdfPCell(picturer);

        cell_picturer.Border = 0;
        cell_picturer.HorizontalAlignment = Element.ALIGN_RIGHT;
        cell_picturer.VerticalAlignment   = 1;
        cell_picturer.Rowspan             = 3;

        tableH.AddCell(new PdfPCell(cell_logo));
        tableH.AddCell(new Phrase("แบบฟอร์มข้อมูลอาจารย์พิเศษ", objPdf.bold_font));
        tableH.AddCell(new PdfPCell(cell_picturer));

        tableH.AddCell(new Phrase("คณะสถาปัตยกรรมและการออกแบบ", objPdf.bold_font));
        tableH.AddCell(new Phrase("มหาวิทยาลัยเทคโนโลยีพระจอมเกล้าพระนครเหนือ", objPdf.bold_font));

        doc.Add(tableH);

        PdfPTable tableBlank = new PdfPTable(1);

        tableBlank.DefaultCell.Border = 0;
        tableBlank.AddCell(new Phrase(".", objPdf.white_font));
        doc.Add(tableBlank);

        PdfPTable tableProfile = new PdfPTable(2);

        tableProfile.DefaultCell.Border = 0;
        tableProfile.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        float[] widthsProfile = new float[] { 0.3f, 6.7f };
        tableProfile.SetWidths(widthsProfile);

        tableProfile.AddCell(new Phrase("1.", objPdf.small_font));
        tableProfile.AddCell(new Phrase("ชื่อ  " + prefix + thai_name + "          นามสกุล  " + thai_surname, objPdf.small_font));

        tableProfile.AddCell(new Phrase(".", objPdf.white_font));
        tableProfile.AddCell(new Phrase("ตำแหน่งทางวิชาการ  " + academic_position, objPdf.small_font));

        tableProfile.AddCell(new Phrase(".", objPdf.white_font));
        PdfPTable tb1 = new PdfPTable(3);

        tb1.DefaultCell.Border = 0;
        tb1.SetWidths(new float[] { 1, 1, 1 });
        tb1.AddCell(new Phrase("สัญชาติ  " + nationality, objPdf.small_font));
        tb1.AddCell(new Phrase("เชื้อชาติ  " + ethnicity, objPdf.small_font));
        tb1.AddCell(new Phrase("ศาสนา  " + religion, objPdf.small_font));
        tableProfile.AddCell(tb1);
        // tableProfile.AddCell(new Phrase("สัญชาติ  " + nationality + "          เชื้อชาติ  " + ethnicity + "          ศาสนา  " + religion, objPdf.small_font));

        tableProfile.AddCell(new Phrase("2.", objPdf.small_font));
        tableProfile.AddCell(new Phrase("เกิดวันที่  " + birth_day, objPdf.small_font));

        tableProfile.AddCell(new Phrase("3.", objPdf.small_font));
        tableProfile.AddCell(new Phrase("บัตรประจำตัวประชาชนเลขที่  " + nation_id, objPdf.small_font));

        tableProfile.AddCell(new Phrase(".", objPdf.white_font));
        PdfPTable tb2 = new PdfPTable(3);

        tb2.DefaultCell.Border = 0;
        tb2.SetWidths(new float[] { 1, 1, 1 });
        tb2.AddCell(new Phrase("ออกโดย  " + issue_by, objPdf.small_font));
        tb2.AddCell(new Phrase("วันที่ออกบัตร  " + issue_date, objPdf.small_font));
        tb2.AddCell(new Phrase("วันที่หมดอายุ  " + expire_date, objPdf.small_font));
        tableProfile.AddCell(tb2);
        //tableProfile.AddCell(new Phrase("ออกโดย  " + issue_by + "          วันที่ออกบัตร  " + issue_date + "          วันที่หมดอายุ  " + expire_date, objPdf.small_font));

        tableProfile.AddCell(new Phrase("4.", objPdf.small_font));
        tableProfile.AddCell(new Phrase("ใบอนุญาตประกอบวิชาชีพเลขที่ (ถ้ามี)  " + license_id, objPdf.small_font));

        tableProfile.AddCell(new Phrase(".", objPdf.white_font));
        PdfPTable tb3 = new PdfPTable(3);

        tb3.DefaultCell.Border = 0;
        tb3.SetWidths(new float[] { 1, 1, 1 });
        tb3.AddCell(new Phrase("ออกโดย  " + license_issue_by, objPdf.small_font));
        tb3.AddCell(new Phrase("วันที่ออกบัตร  " + license_issue_date, objPdf.small_font));
        tb3.AddCell(new Phrase("วันที่หมดอายุ  " + license_expire_date, objPdf.small_font));
        tableProfile.AddCell(tb3);
        //tableProfile.AddCell(new Phrase("ออกโดย  " + license_issue_by + "          วันที่ออกบัตร  " + license_issue_date + "          วันที่หมดอายุ  " + license_expire_date, objPdf.small_font));

        tableProfile.AddCell(new Phrase("5.", objPdf.small_font));
        tableProfile.AddCell(new Phrase("ที่อยู่ปัจจุบันบ้านเลขที่  " + home_address + "   หมู่ที่/หมู่บ้าน  " + home_moo + "   " + home_vilage_building + "   ซอย  " + home_soi, objPdf.small_font));

        tableProfile.AddCell(new Phrase(".", objPdf.white_font));
        PdfPTable tb4 = new PdfPTable(3);

        tb4.DefaultCell.Border = 0;
        tb4.SetWidths(new float[] { 1, 1, 1 });
        tb4.AddCell(new Phrase("ถนน  " + home_road, objPdf.small_font));
        tb4.AddCell(new Phrase("ตำบล/แขวง  " + home_tumbol, objPdf.small_font));
        tb4.AddCell(new Phrase("อำเภอ/เขต  " + home_amphur, objPdf.small_font));
        tableProfile.AddCell(tb4);
        //tableProfile.AddCell(new Phrase("ถนน  " + home_road + "          ตำบล/แขวง  " + home_tumbol + "          อำเภอ/เขต  " + home_amphur, objPdf.small_font));

        tableProfile.AddCell(new Phrase(".", objPdf.white_font));
        PdfPTable tb5 = new PdfPTable(3);

        tb5.DefaultCell.Border = 0;
        tb5.SetWidths(new float[] { 1, 1, 1 });
        tb5.AddCell(new Phrase("จังหวัด  " + home_provice, objPdf.small_font));
        tb5.AddCell(new Phrase("เบอร์โทรศัพท์  " + home_phone, objPdf.small_font));
        tb5.AddCell(new Phrase("มือถือ  " + home_mobile, objPdf.small_font));
        tableProfile.AddCell(tb5);
        //tableProfile.AddCell(new Phrase("จังหวัด  " + home_provice + "          เบอร์โทรศัพท์  " + home_phone + "          มือถือ  " + home_mobile, objPdf.small_font));

        tableProfile.AddCell(new Phrase(".", objPdf.white_font));
        tableProfile.AddCell(new Phrase("สถานที่ทำงาน  " + work_address, objPdf.small_font));

        tableProfile.AddCell(new Phrase("6.", objPdf.small_font));
        tableProfile.AddCell(new Phrase("E-mail address  " + email, objPdf.small_font));

        doc.Add(tableProfile);

        doc.Add(tableBlank);

        PdfPTable tablePreHis = new PdfPTable(2);

        tablePreHis.DefaultCell.Border = 0;
        tablePreHis.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreHis.DefaultCell.PaddingBottom       = 5;
        float[] widthsPreHis = new float[] { 0.3f, 6.7f };
        tablePreHis.SetWidths(widthsPreHis);

        tablePreHis.AddCell(new Phrase("7.", objPdf.small_font));
        tablePreHis.AddCell(new Phrase("ประวัติการศึกษา (ระดับมัธยมศึกษาตอนปลาย ถึง อุดมศึกษา)", objPdf.small_font));
        doc.Add(tablePreHis);

        PdfPTable tableHis = new PdfPTable(5);

        tableHis.DefaultCell.Border = Rectangle.BOX;
        tableHis.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
        tableHis.DefaultCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
        tableHis.DefaultCell.PaddingBottom       = 5;
        float[] widthHis = new float[] { 1f, 2.2f, 1.3f, 2f, 0.5f };
        tableHis.SetWidths(widthHis);

        tableHis.AddCell(new Phrase("ปี พ.ศ.", objPdf.small_bold_font));
        tableHis.AddCell(new Phrase("ชื่อสถาบันที่ศึกษา", objPdf.small_bold_font));
        tableHis.AddCell(new Phrase("จังหวัด/ประเทศ", objPdf.small_bold_font));
        tableHis.AddCell(new Phrase("ชื่อประกาศนียบัตร/ปริญญา", objPdf.small_bold_font));
        tableHis.AddCell(new Phrase("G.P.A.", objPdf.small_bold_font));

        foreach (QualificationDetail item in qualificationDetail)
        {
            string province = "";
            if (item.Province_Code == "00")
            {
                province = item.Province_Other + Environment.NewLine + new Country().getCountry(item.Country_Code).Country_ThaiName;
            }
            else
            {
                province = new Province().getProvince(item.Province_Code).Province_ThaiName + Environment.NewLine + new Country().getCountry(item.Country_Code).Country_ThaiName;
            }

            tableHis.AddCell(new Phrase(item.Year, objPdf.small_font));
            tableHis.AddCell(new PdfPCell(new Phrase(item.Academy, objPdf.small_font))
            {
                HorizontalAlignment = Element.ALIGN_LEFT, VerticalAlignment = Element.ALIGN_MIDDLE, PaddingBottom = 5
            });
            tableHis.AddCell(new Phrase(province, objPdf.small_font));
            tableHis.AddCell(new Phrase(item.QualificationDegree + Environment.NewLine + item.Division, objPdf.small_font));
            tableHis.AddCell(new Phrase(item.gpa, objPdf.small_font));
        }

        doc.Add(tableHis);

        doc.Add(tableBlank);

        PdfPTable tablePreScholar = new PdfPTable(2);

        tablePreScholar.DefaultCell.Border = 0;
        tablePreScholar.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreScholar.DefaultCell.PaddingBottom       = 5;
        float[] widthsPreScholar = new float[] { 0.3f, 6.7f };
        tablePreScholar.SetWidths(widthsPreScholar);

        tablePreScholar.AddCell(new Phrase("8.", objPdf.small_font));
        tablePreScholar.AddCell(new Phrase("เคยได้รับทุนการศึกษา", objPdf.small_font));
        doc.Add(tablePreScholar);

        PdfPTable tableScholar = new PdfPTable(3);

        tableScholar.DefaultCell.Border = Rectangle.BOX;
        tableScholar.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
        tableScholar.DefaultCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
        tableScholar.DefaultCell.PaddingBottom       = 5;
        float[] widthScholar = new float[] { 1f, 3.5f, 2.5f };
        tableScholar.SetWidths(widthScholar);

        tableScholar.AddCell(new Phrase("ปี พ.ศ.", objPdf.small_bold_font));
        tableScholar.AddCell(new Phrase("ชื่อทุน", objPdf.small_bold_font));
        tableScholar.AddCell(new Phrase("วัตถุประสงค์/กิจกรรม", objPdf.small_bold_font));

        int row_sch = 3 - lecturerSholarship.Count;

        foreach (LecturerSholarship item in lecturerSholarship)
        {
            tableScholar.AddCell(new Phrase(item.ScholarYear, objPdf.small_font));
            tableScholar.AddCell(new PdfPCell(new Phrase(item.ScholarName, objPdf.small_font))
            {
                HorizontalAlignment = Element.ALIGN_LEFT, VerticalAlignment = Element.ALIGN_MIDDLE, PaddingBottom = 5
            });
            tableScholar.AddCell(new PdfPCell(new Phrase(item.ScholarPurpose, objPdf.small_font))
            {
                HorizontalAlignment = Element.ALIGN_LEFT, VerticalAlignment = Element.ALIGN_MIDDLE, PaddingBottom = 5
            });
        }

        for (int i = 0; i < row_sch; i++)
        {
            tableScholar.AddCell(new Phrase(" ", objPdf.small_font));
            tableScholar.AddCell(new Phrase(" ", objPdf.small_font));
            tableScholar.AddCell(new Phrase(" ", objPdf.small_font));
        }

        doc.Add(tableScholar);

        // =============== Page 2 ==========
        doc.NewPage();

        PdfPTable tablePreWork = new PdfPTable(2);

        tablePreWork.DefaultCell.Border = 0;
        tablePreWork.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreWork.DefaultCell.PaddingBottom       = 5;
        float[] widthsPreWork = new float[] { 0.3f, 6.7f };
        tablePreWork.SetWidths(widthsPreWork);

        tablePreWork.AddCell(new Phrase("9.", objPdf.small_font));
        tablePreWork.AddCell(new Phrase("ประสบการณ์ทำงาน", objPdf.small_font));
        doc.Add(tablePreWork);

        PdfPTable tablePreWork1 = new PdfPTable(2);

        tablePreWork1.DefaultCell.Border = 0;
        tablePreWork1.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreWork1.DefaultCell.PaddingBottom       = 5;
        float[] widthsPreWork1 = new float[] { 0.7f, 6.3f };
        tablePreWork1.SetWidths(widthsPreWork1);
        tablePreWork1.AddCell(new PdfPCell(new Phrase("9.1", objPdf.small_font))
        {
            HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
        });
        tablePreWork1.AddCell(new Phrase("ประสบการณ์ในการทำงานหรือการสอน", objPdf.small_font));
        doc.Add(tablePreWork1);

        PdfPTable tableWork = new PdfPTable(4);

        tableWork.DefaultCell.Border = Rectangle.BOX;
        tableWork.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
        tableWork.DefaultCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
        tableWork.DefaultCell.PaddingBottom       = 5;
        float[] widthWork = new float[] { 2.5f, 1.5f, 1.5f, 1.5f };
        tableWork.SetWidths(widthWork);

        tableWork.AddCell(new Phrase("บริษัท/ชื่อวิชาที่สอน", objPdf.small_bold_font));
        tableWork.AddCell(new Phrase("ลักษณะงาน (อ.ประจำ/อ.พิเศษ)", objPdf.small_bold_font));
        tableWork.AddCell(new Phrase("ปีที่เริ่ม - สิ้นสุด", objPdf.small_bold_font));
        tableWork.AddCell(new Phrase("สาเหตุที่ออก", objPdf.small_bold_font));

        List <LecturerExprience> exprience_data = new List <LecturerExprience>();
        string exprience_sql = "Select * From LECTUREREXPRIENCE Where LECTIDENTITY='" + code + "' Order by BEGINYEAR";

        exprience_data = new LecturerExprience().getLecturerExprienceManual(exprience_sql);
        int row_work = 3 - exprience_data.Count;

        foreach (LecturerExprience item in exprience_data)
        {
            tableWork.AddCell(new PdfPCell(new Phrase(item.SubjectName, objPdf.small_font))
            {
                HorizontalAlignment = Element.ALIGN_LEFT, VerticalAlignment = Element.ALIGN_MIDDLE, PaddingBottom = 5
            });
            tableWork.AddCell(new PdfPCell(new Phrase(item.LecturerType, objPdf.small_font))
            {
                HorizontalAlignment = Element.ALIGN_LEFT, VerticalAlignment = Element.ALIGN_MIDDLE, PaddingBottom = 5
            });
            tableWork.AddCell(new Phrase(item.BeginYear + " - " + item.EndYear, objPdf.small_font));
            tableWork.AddCell(new PdfPCell(new Phrase(item.QuitIssue, objPdf.small_font))
            {
                HorizontalAlignment = Element.ALIGN_LEFT, VerticalAlignment = Element.ALIGN_MIDDLE, PaddingBottom = 5
            });
        }

        for (int i = 0; i < row_work; i++)
        {
            tableWork.AddCell(new Phrase(" ", objPdf.small_font));
            tableWork.AddCell(new Phrase(" ", objPdf.small_font));
            tableWork.AddCell(new Phrase(" ", objPdf.small_font));
            tableWork.AddCell(new Phrase(" ", objPdf.small_font));
        }

        doc.Add(tableWork);

        doc.Add(tableBlank);

        PdfPTable tablePreResearch = new PdfPTable(2);

        tablePreResearch.DefaultCell.Border = 0;
        tablePreResearch.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreResearch.DefaultCell.PaddingBottom       = 5;
        float[] widthsResearch = new float[] { 0.7f, 6.3f };
        tablePreResearch.SetWidths(widthsResearch);
        tablePreResearch.AddCell(new PdfPCell(new Phrase("9.2", objPdf.small_font))
        {
            HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
        });
        tablePreResearch.AddCell(new Phrase("ประสบการณ์ในการวิจัย/บทความวิชาการ/งานสร้างสรรค์", objPdf.small_font));
        doc.Add(tablePreResearch);

        PdfPTable tableResearch = new PdfPTable(4);

        tableResearch.DefaultCell.Border = Rectangle.BOX;
        tableResearch.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
        tableResearch.DefaultCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
        tableResearch.DefaultCell.PaddingBottom       = 5;
        float[] widthResearch = new float[] { 1f, 3f, 1.5f, 1.5f };
        tableResearch.SetWidths(widthResearch);

        tableResearch.AddCell(new Phrase("ปี พ.ศ.", objPdf.small_bold_font));
        tableResearch.AddCell(new Phrase("ชื่อผลงาน", objPdf.small_bold_font));
        tableResearch.AddCell(new Phrase("ประเภท", objPdf.small_bold_font));
        tableResearch.AddCell(new Phrase("ตีพิมพ์ในวารสาร", objPdf.small_bold_font));

        List <LecturerPublication> research_data = new List <LecturerPublication>();
        string research_sql = "Select * From LECTURERPUBLICATION Where LECTIDENTITY='" + code + "' Order by PUBLISHEDYEAR";

        research_data = new LecturerPublication().getLecturerPublicationManual(research_sql);

        int row_research = 3 - research_data.Count;

        foreach (LecturerPublication item in research_data)
        {
            tableResearch.AddCell(new Phrase(item.PublishedYear, objPdf.small_font));
            tableResearch.AddCell(new PdfPCell(new Phrase(item.PublicationName, objPdf.small_font))
            {
                HorizontalAlignment = Element.ALIGN_LEFT, VerticalAlignment = Element.ALIGN_MIDDLE, PaddingBottom = 5
            });
            tableResearch.AddCell(new Phrase(item.PublicationType, objPdf.small_font));
            tableResearch.AddCell(new Phrase(item.Ppoceeding, objPdf.small_font));
        }

        for (int i = 0; i < row_research; i++)
        {
            tableResearch.AddCell(new Phrase(" ", objPdf.small_font));
            tableResearch.AddCell(new Phrase(" ", objPdf.small_font));
            tableResearch.AddCell(new Phrase(" ", objPdf.small_font));
            tableResearch.AddCell(new Phrase(" ", objPdf.small_font));
        }

        doc.Add(tableResearch);

        doc.Add(tableBlank);

        PdfPTable tablePreBook = new PdfPTable(2);

        tablePreBook.DefaultCell.Border = 0;
        tablePreBook.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreBook.DefaultCell.PaddingBottom       = 5;
        float[] widthsBook = new float[] { 0.7f, 6.3f };
        tablePreBook.SetWidths(widthsBook);
        tablePreBook.AddCell(new PdfPCell(new Phrase("9.3", objPdf.small_font))
        {
            HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
        });
        tablePreBook.AddCell(new Phrase("เอกสารตำรา/หนังสือ", objPdf.small_font));
        doc.Add(tablePreBook);

        PdfPTable tableBook = new PdfPTable(3);

        tableBook.DefaultCell.Border = Rectangle.BOX;
        tableBook.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
        tableBook.DefaultCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
        tableBook.DefaultCell.PaddingBottom       = 5;
        float[] widthBook = new float[] { 4f, 1.5f, 1.5f };
        tableBook.SetWidths(widthBook);

        tableBook.AddCell(new Phrase("ชื่อตำรา/หนังสือ", objPdf.small_bold_font));
        tableBook.AddCell(new Phrase("ปีที่ตีพิมพ์", objPdf.small_bold_font));
        tableBook.AddCell(new Phrase("สำนักพิมพ์", objPdf.small_bold_font));

        List <LecturerBook> book_data = new List <LecturerBook>();

        string sql_book = "Select * From LECTURERBOOK Where LECTIDENTITY='" + code + "' Order by PUBLISHEDYEAR";

        book_data = new LecturerBook().getLecturerBookManual(sql_book);

        int row_book = 3 - book_data.Count;

        foreach (LecturerBook item in book_data)
        {
            tableBook.AddCell(new PdfPCell(new Phrase(item.BookName, objPdf.small_font))
            {
                HorizontalAlignment = Element.ALIGN_LEFT, VerticalAlignment = Element.ALIGN_MIDDLE, PaddingBottom = 5
            });
            tableBook.AddCell(new Phrase(item.PublishedYear, objPdf.small_font));
            tableBook.AddCell(new Phrase(item.Publisher, objPdf.small_font));
        }

        for (int i = 0; i < row_book; i++)
        {
            tableBook.AddCell(new Phrase(" ", objPdf.small_font));
            tableBook.AddCell(new Phrase(" ", objPdf.small_font));
            tableBook.AddCell(new Phrase(" ", objPdf.small_font));
        }

        doc.Add(tableBook);

        // =============== Page 3 ==========
        doc.NewPage();

        string bank_account_name = sysuserData2.BankAccountName;
        string bank_branch       = sysuserData2.BankBranch;
        string bank_account_num  = sysuserData2.BankAccountNumber;

        PdfPTable tablePreBankAcc = new PdfPTable(2);

        tablePreBankAcc.DefaultCell.Border = 0;
        tablePreBankAcc.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreBankAcc.DefaultCell.PaddingBottom       = 5;
        float[] widthsBankAcc = new float[] { 0.3f, 6.7f };
        tablePreBankAcc.SetWidths(widthsBankAcc);

        tablePreBankAcc.AddCell(new Phrase("10.", objPdf.small_font));
        tablePreBankAcc.AddCell(new Phrase("ข้าพเจ้ายินดีที่จะปฏิบัติตามแนวทางที่คณะสถาปัตยากรรมและการออกแบบกำหนดไว้ดังต่อไปนี้", objPdf.small_font));
        doc.Add(tablePreBankAcc);

        PdfPTable tablePreBankAcc1 = new PdfPTable(2);

        tablePreBankAcc1.DefaultCell.Border = 0;
        tablePreBankAcc1.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreBankAcc1.DefaultCell.PaddingBottom       = 5;
        float[] widthsPreBankAcc1 = new float[] { 0.7f, 6.3f };
        tablePreBankAcc1.SetWidths(widthsPreBankAcc1);
        tablePreBankAcc1.AddCell(new PdfPCell(new Phrase("10.1)", objPdf.small_font))
        {
            HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
        });

        Phrase acc1 = new Phrase();

        acc1.Add(new Phrase("เปิดบัญชีธนาคารกรุงเทพ จำกัด (มหาชน) เพื่อรับค่าสอนโดยโอนเงินเข้า ชื่อบัญชี  ", objPdf.small_font));
        acc1.Add(new Phrase(bank_account_name, objPdf.small_bold_font));

        tablePreBankAcc1.AddCell(acc1);
        doc.Add(tablePreBankAcc1);

        PdfPTable tablePreBankAcc2 = new PdfPTable(2);

        tablePreBankAcc2.DefaultCell.Border = 0;
        tablePreBankAcc2.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreBankAcc2.DefaultCell.PaddingBottom       = 5;
        float[] widthsPreBankAcc2 = new float[] { 1f, 1f };
        tablePreBankAcc2.SetWidths(widthsPreBankAcc2);

        Phrase acc2 = new Phrase();

        acc2.Add(new Phrase("สาขา  ", objPdf.small_font));
        acc2.Add(new Phrase(bank_branch, objPdf.small_bold_font));
        tablePreBankAcc2.AddCell(acc2);

        Phrase acc3 = new Phrase();

        acc3.Add(new Phrase("เลขที่บัญชี  ", objPdf.small_font));
        acc3.Add(new Phrase(bank_account_num, objPdf.small_bold_font));
        tablePreBankAcc2.AddCell(acc3);

        doc.Add(tablePreBankAcc2);

        PdfPTable tablePreBankAcc3 = new PdfPTable(2);

        tablePreBankAcc3.DefaultCell.Border = 0;
        tablePreBankAcc3.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreBankAcc3.DefaultCell.PaddingBottom       = 5;
        float[] widthsPreBankAcc3 = new float[] { 0.7f, 6.3f };
        tablePreBankAcc3.SetWidths(widthsPreBankAcc3);
        tablePreBankAcc3.AddCell(new PdfPCell(new Phrase("10.2)", objPdf.small_font))
        {
            HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
        });

        tablePreBankAcc3.AddCell(new Phrase("จัดส่ง มคอ.3 และ มคอ.5 ตามวันและเวลาที่งานวิชาการกำหนด เพื่อเป็นไปตามกฎเกณฑ์มาตราฐานการประกัน", objPdf.small_font));

        doc.Add(tablePreBankAcc3);

        PdfPTable tablePreBankAcc3_1 = new PdfPTable(1);

        tablePreBankAcc3_1.DefaultCell.Border = 0;
        tablePreBankAcc3_1.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreBankAcc3_1.DefaultCell.PaddingBottom       = 5;
        float[] widthsPreBankAcc3_1 = new float[] { 1f };
        tablePreBankAcc3_1.SetWidths(widthsPreBankAcc3_1);

        tablePreBankAcc3_1.AddCell(new Phrase("คุณภาพการศึกษาภายใน ตามที่สำนักงานคณะกรรมการการอุดมศึกษากำหนด", objPdf.small_font));

        doc.Add(tablePreBankAcc3_1);

        PdfPTable tablePreBankAcc4 = new PdfPTable(2);

        tablePreBankAcc4.DefaultCell.Border = 0;
        tablePreBankAcc4.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreBankAcc4.DefaultCell.PaddingBottom       = 5;
        float[] widthsPreBankAcc4 = new float[] { 0.7f, 6.3f };
        tablePreBankAcc4.SetWidths(widthsPreBankAcc4);
        tablePreBankAcc4.AddCell(new PdfPCell(new Phrase("10.3)", objPdf.small_font))
        {
            HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
        });

        tablePreBankAcc4.AddCell(new Phrase("จัดส่งคะแนนสอบกลางภาคและปลายภาคได้ตามวันและเวลาที่งานวิชาการกำหนด", objPdf.small_font));

        doc.Add(tablePreBankAcc4);

        PdfPTable tablePreBankAcc5 = new PdfPTable(2);

        tablePreBankAcc5.DefaultCell.Border = 0;
        tablePreBankAcc5.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreBankAcc5.DefaultCell.PaddingBottom       = 5;
        float[] widthsPreBankAcc5 = new float[] { 0.7f, 6.3f };
        tablePreBankAcc5.SetWidths(widthsPreBankAcc5);
        tablePreBankAcc5.AddCell(new PdfPCell(new Phrase("10.4)", objPdf.small_font))
        {
            HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
        });

        tablePreBankAcc5.AddCell(new Phrase("ร่วมเป็นคณะกรรมการคุมสอบในรายวิชาทฤษฎีและประลองทั้งกลางภาคและปลายภาค ในกรณีวิชาที่รับผิดชอบ", objPdf.small_font));

        doc.Add(tablePreBankAcc5);

        PdfPTable tablePreBankAcc5_1 = new PdfPTable(1);

        tablePreBankAcc5_1.DefaultCell.Border = 0;
        tablePreBankAcc5_1.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreBankAcc5_1.DefaultCell.PaddingBottom       = 5;
        float[] widthsPreBankAcc5_1 = new float[] { 1f };
        tablePreBankAcc5_1.SetWidths(widthsPreBankAcc5_1);

        tablePreBankAcc5_1.AddCell(new Phrase("มีการสอบ โดยงานวิชาการจะจัดให้คุมสอบตามวันเวลาที่ดำเนินการสอน ทั้งนี้สัปดาห์ที่สอบจะไม่มีการเรียนการสอน", objPdf.small_font));

        doc.Add(tablePreBankAcc5_1);

        doc.Add(tableBlank);

        PdfPTable tablePreAttach = new PdfPTable(2);

        tablePreAttach.DefaultCell.Border = 0;
        tablePreAttach.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tablePreAttach.DefaultCell.PaddingBottom       = 5;
        float[] widthsAttach = new float[] { 0.3f, 6.7f };
        tablePreAttach.SetWidths(widthsAttach);

        var  uncheck_box = new Chunk("o", objPdf.wingding_font16);
        char ch          = (char)254;
        var  check_box   = new Chunk(ch, objPdf.wingding_font16);

        tablePreAttach.AddCell(new Phrase("11.", objPdf.small_font));
        tablePreAttach.AddCell(new Phrase("ข้าพเจ้าได้แนบหลักฐาน/เอกสารที่เกี่ยวข้องดังรายการต่อไปนี้", objPdf.small_font));
        doc.Add(tablePreAttach);

        PdfPTable tableAttach1 = new PdfPTable(2);

        tableAttach1.DefaultCell.Border = 0;
        tableAttach1.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
        tableAttach1.DefaultCell.PaddingBottom       = 5;
        float[] widthsAttach1 = new float[] { 0.7f, 6.3f };
        tableAttach1.SetWidths(widthsAttach1);

        LecturerEvidence attach = new LecturerEvidence().getLecturerEvidence(sysUserData.IdCode);

        if (attach.Evidence1 == "Y")
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(check_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        else
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(uncheck_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        tableAttach1.AddCell(new Phrase("สำเนาใบปริญญาบัตร 1 ฉบับ (ของทุกระดับที่สำเร็จการศึกษา)", objPdf.small_font));

        if (attach.Evidence2 == "Y")
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(check_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        else
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(uncheck_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        tableAttach1.AddCell(new Phrase("สำเนา Transcript 1 ฉบับ (ของทุกระดับที่สำเร็จการศึกษา)", objPdf.small_font));

        if (attach.Evidence3 == "Y")
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(check_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        else
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(uncheck_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        tableAttach1.AddCell(new Phrase("รูปถ่ายหน้าตรง 1 นิ้ว ไม่สวมหมวก ไม่ใส่แว่นตาดำ ถ่ายมาแล้วไม่เกิน 1 ปี (ติดที่แบบฟอร์ม)", objPdf.small_font));

        if (attach.Evidence4 == "Y")
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(check_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        else
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(uncheck_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        tableAttach1.AddCell(new Phrase("สำเนาบัตรประจำตัวประชาชน หรือสำเนาบัตรประจำตัวข้าราชการ/พนักงานมหาวิทยาลัย 1 ฉบับ", objPdf.small_font));

        if (attach.Evidence5 == "Y")
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(check_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        else
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(uncheck_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        tableAttach1.AddCell(new Phrase("สำเนาทะเบียนบ้าน 1 ฉบับ", objPdf.small_font));

        if (attach.Evidence6 == "Y")
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(check_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        else
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(uncheck_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        tableAttach1.AddCell(new Phrase("สำเนาสมุดบัญชี (เฉพาะหน้าแรก) ธนาคารกรุงเทพ 1 ฉบับ", objPdf.small_font));

        if (attach.Evidence7 == "Y")
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(check_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        else
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(uncheck_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        tableAttach1.AddCell(new Phrase("สำเนาใบประกอบวิชาชีพ 1 ฉบับ (ถ้ามี)", objPdf.small_font));

        if (attach.Evidence8 == "Y")
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(check_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        else
        {
            tableAttach1.AddCell(new PdfPCell(new Phrase(uncheck_box))
            {
                HorizontalAlignment = Element.ALIGN_RIGHT, Border = 0, PaddingBottom = 5
            });
        }
        tableAttach1.AddCell(new Phrase("อื่น ๆ  (กรณีมีเอกสารเพิ่มเติมจากที่กล่าวมา โปรดระบุ)...........................................................................................", objPdf.small_font));

        doc.Add(tableAttach1);

        doc.Add(tableBlank);

        PdfPTable tableSign = new PdfPTable(1);

        tableSign.DefaultCell.Border = 0;
        tableSign.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGHT;
        tableSign.DefaultCell.PaddingBottom       = 5;
        float[] widthsSign = new float[] { 1f };
        tableSign.SetWidths(widthsSign);

        tableSign.AddCell(new Phrase("ขอรับรองว่าข้อความดังกล่าวข้างต้นเป็นความจริงทุกประการ", objPdf.small_font));

        tableSign.AddCell(new Phrase(".", objPdf.white_font));
        tableSign.AddCell(new Phrase(".", objPdf.white_font));

        tableSign.AddCell(new Phrase("ลงชื่อผู้สมัคร...........................................................................", objPdf.small_font));
        tableSign.AddCell(new Phrase("(.........................................................................)", objPdf.small_font));
        tableSign.AddCell(new Phrase("วันที่....................../........................./.........................", objPdf.small_font));

        doc.Add(tableSign);
        // =================================

        writer.CloseStream = false;
        doc.Close();
        memoryStream.Position = 0;

        string pdfFile = "";

        pdfFile = lectuere_id + "_" + DateTime.Now.ToString().Replace(" ", "_") + ".pdf";
        objPdf.ExportPDF(Response, memoryStream, pdfFile);
    }
コード例 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["login_data"] == null)
        {
            Response.Redirect("../index.aspx");
        }
        else
        {
            //ตรวจสอบสิทธิ์
            login_data = (UserLoginData)Session["login_data"];
            if (autro_obj.CheckGroupUser(login_data, group_var.officer_faculty) || autro_obj.CheckGroupUser(login_data, group_var.officer_department))
            {
                // ======== Process ===========
                //ทดสอบ ชั่วคราว ลบออกเมื่อใช้งานจริง
                //Session["CurrCode"] = "707012555";
                //Session["YearVersion"] = "2555";
                //Session["NumTQF1"] = "001";
                if (Session["CurrCode"] == null || Session["YearVersion"] == null || Session["NumTQF1"] == null)
                {
                    Response.Redirect("listCURR.aspx");
                }
                else
                {
                    CurrCode    = Session["CurrCode"].ToString();
                    YearVersion = Session["YearVersion"].ToString();
                    NumTQF1     = Session["NumTQF1"].ToString();
                }

                TQF.Curriculum curriculum    = new TQF.Curriculum().getCurriculum(CurrCode, YearVersion);
                StructurePlan  structurePlan = new StructurePlan().getStructurePlan(CurrCode, YearVersion);

                Label1.Text = curriculum.CurrThName;
                //Label2.Text = curriculum.MajorName;
                if (curriculum.CurrStatus == "1")
                {
                    //สถานะของหลักสูตร(1=ใหม่, 2=ปรับปรุง)
                    curriculum.CurrStatus = "หลักสูตรใหม่";
                }
                else
                {
                    curriculum.CurrStatus = "หลักสูตรปรับปรุง";
                }
                Label3.Text = "(" + curriculum.CurrStatus + " พ.ศ. " + curriculum.YearVersion + ")";

                Label4.Text = "มหาวิทยาลัยเทคโนโลยีพระจอมเกล้าพระนครเหนือ";

                Label5.Text = new Faculty().getFaculty(curriculum.FacultyCode).Faculty_Thai + " ";
                Label6.Text = new Department().getDepartment(curriculum.DepartmentCode).Department_Thai;

                //รหัสและชื่อหลักสูตร
                Label7.Text  = curriculum.CurrCode;
                Label8.Text  = curriculum.CurrThName;
                Label9.Text  = curriculum.CurrShortThName;
                Label10.Text = curriculum.CurrEnName;
                Label11.Text = curriculum.CurrShortEnName;

                //ถ้าไม่ใช่หลักสูตรวิชาบริการ (999999999)
                if (CurrCode != "999999999")
                {
                    //ชื่อปริญญาและสาขาวิชา
                    Label12.Text = new Diploma().getDiploma(curriculum.DiplomaCode).DomainThName;
                    Label13.Text = new Diploma().getDiploma(curriculum.DiplomaCode).DomainThShortName;
                    Label14.Text = new Diploma().getDiploma(curriculum.DiplomaCode).DomainEnName;
                    Label15.Text = new Diploma().getDiploma(curriculum.DiplomaCode).DomainEnShortName;

                    //วันที่อนุมัติหลักสูตร และภาคการศึกษาที่เริ่มใช้หลักสูตร
                    Label16.Text = new utility().getThaiBirthDay(curriculum.ApprovedDate);
                    Label17.Text = curriculum.BeginSemester + "/" + curriculum.YearVersion;

                    //จำนวนหน่วยกิตที่เรียนตลอดหลักสูตร
                    Label18.Text = structurePlan.TotalCredits + " หน่วยกิต";
                }

                //รูปแบบของหลักสูตร
                string sqlStructurePlan = "Select * From STRUCTUREPLAN Where CURRCODE='" + CurrCode + "' And YEARVERSION='" + YearVersion + "'";
                List <StructurePlan> dataStructurePlan = new StructurePlan().getStructurePlanManual(sqlStructurePlan);

                foreach (StructurePlan data in dataStructurePlan)
                {
                    Label19.Text = new CurrFormat().getCurrFormat(data.CurrFormatCode).CurrFormatName;
                    if (dataStructurePlan.Count > 1)
                    {
                        Label19.Text += "<br>";
                    }

                    //Tab 2: โครงสร้างหลักสูตร
                    htmlGenerateTab2(data.MajorCode, data.CurrFormatCode, data.TotalCredits, data.YearVersion, data.CurrTypeCode);

                    //Tab 3: รายวิชาในหลักสูตร
                    htmlGenerateTab3(data.MajorCode, data.CurrFormatCode, data.TotalCredits, data.YearVersion, data.CurrTypeCode);

                    //Tab 4: แผนการศึกษา
                    htmlGenerateTab4(data.MajorCode, data.CurrFormatCode, data.TotalCredits, data.YearVersion, data.CurrTypeCode);

                    //Tab 5: คำอธิบายรายวิชา
                    htmlGenerateTab5(data.MajorCode, data.CurrFormatCode, data.TotalCredits, data.YearVersion, data.CurrTypeCode);
                }

                Label20.Text = curriculum.NumYear + " ปี / " + curriculum.MaxNumYear + " ปี";

                //อาจารย์ผู้รับผิดชอบหลักสูตร
                //ความหมาย LOADTYPECODE
                //1	อาจารย์ประจำหลักสูตร
                //4	อาจารย์ประจำแขนง
                string sqlLecturer = "Select * From ABOUTLECTURER Where CURRCODE='" + CurrCode + "' And YEARVERSION='" + YearVersion + "' And LOADTYPECODE='1' Order By LECTIDENTITY";
                List <AboutLecturer> aboutLecturer = new AboutLecturer().getAboutLecturerManual(sqlLecturer);
                int i = 1;
                foreach (AboutLecturer data in aboutLecturer)
                {
                    SysUser          sysUser  = new SysUser().getSysUser(data.LectIdentity);
                    AcademicPosition position = new AcademicPosition().getAcademicPosition(sysUser.AcademicPositionCode);

                    Label21.Text += "<span class=\"report-indent-1em\">" + i + ". " + position.AcademicPositionThName + sysUser.ThName + " " + sysUser.ThSurName + "</span><BR>";
                    i++;
                }
                //=============================
            }
            else
            {
                HttpContext.Current.Session["response"] = "ตรวจสอบไม่พบสิทธิ์การเข้าใช้งาน";
                HttpContext.Current.Response.Redirect("err_response.aspx");
            }
        }
    }
コード例 #10
0
ファイル: PrintCurr.aspx.cs プロジェクト: blkwarrior/myGIT
    protected void Page_Load(object sender, EventArgs e)
    {
        //ทดสอบ ชั่วคราว ลบออกเมื่อใช้งานจริง
        //Session["CurrCode"] = "707012555";
        //Session["YearVersion"] = "2555";
        //Session["NumTQF1"] = "001";
        CurrCode    = Request.QueryString["CurrCode"];
        YearVersion = Request.QueryString["YearVersion"];

        TQF.Curriculum curriculum    = new TQF.Curriculum().getCurriculum(CurrCode, YearVersion);
        StructurePlan  structurePlan = new StructurePlan().getStructurePlan(CurrCode, YearVersion);

        Label1.Text = curriculum.CurrThName;
        //Label2.Text = curriculum.MajorName;

        if (curriculum.CurrStatus == "1")
        {
            //สถานะของหลักสูตร(1=ใหม่, 2=ปรับปรุง)
            curriculum.CurrStatus = "หลักสูตรใหม่";
        }
        else
        {
            curriculum.CurrStatus = "หลักสูตรปรับปรุง";
        }
        Label3.Text = "(" + curriculum.CurrStatus + " พ.ศ. " + curriculum.YearVersion + ")";
        Label4.Text = "มหาวิทยาลัยเทคโนโลยีพระจอมเกล้าพระนครเหนือ";
        Label5.Text = new Faculty().getFaculty(curriculum.FacultyCode).Faculty_Thai + " ";
        Label6.Text = new Department().getDepartment(curriculum.DepartmentCode).Department_Thai;

        //รหัสและชื่อหลักสูตร
        Label7.Text  = curriculum.CurrCode;
        Label8.Text  = curriculum.CurrThName;
        Label9.Text  = curriculum.CurrShortThName;
        Label10.Text = curriculum.CurrEnName;
        Label11.Text = curriculum.CurrShortEnName;

        if (CurrCode != "999999999")
        {
            //ชื่อปริญญาและสาขาวิชา
            Label12.Text = new Diploma().getDiploma(curriculum.DiplomaCode).DomainThName;
            Label13.Text = new Diploma().getDiploma(curriculum.DiplomaCode).DomainThShortName;
            Label14.Text = new Diploma().getDiploma(curriculum.DiplomaCode).DomainEnName;
            Label15.Text = new Diploma().getDiploma(curriculum.DiplomaCode).DomainEnShortName;

            //วันที่อนุมัติหลักสูตร และภาคการศึกษาที่เริ่มใช้หลักสูตร
            Label16.Text = new utility().getThaiBirthDay(curriculum.ApprovedDate);
            Label17.Text = curriculum.BeginSemester + "/" + curriculum.YearVersion;

            //จำนวนหน่วยกิตที่เรียนตลอดหลักสูตร
            Label18.Text = structurePlan.TotalCredits + " หน่วยกิต";
        }

        //รูปแบบของหลักสูตร
        string sqlStructurePlan = "Select * From STRUCTUREPLAN Where CURRCODE='" + CurrCode + "' And YEARVERSION='" + YearVersion + "'";
        List <StructurePlan> dataStructurePlan = new StructurePlan().getStructurePlanManual(sqlStructurePlan);

        foreach (StructurePlan data in dataStructurePlan)
        {
            Label19.Text = new CurrFormat().getCurrFormat(data.CurrFormatCode).CurrFormatName;
            if (dataStructurePlan.Count > 1)
            {
                Label19.Text += "<br>";
            }

            //Tab 2: โครงสร้างหลักสูตร
            htmlGenerateTab2(data.MajorCode, data.CurrFormatCode, data.TotalCredits, data.YearVersion, data.CurrTypeCode);

            //Tab 3: รายวิชาในหลักสูตร
            htmlGenerateTab3(data.MajorCode, data.CurrFormatCode, data.TotalCredits, data.YearVersion, data.CurrTypeCode);

            //Tab 4: แผนการศึกษา
            htmlGenerateTab4(data.MajorCode, data.CurrFormatCode, data.TotalCredits, data.YearVersion, data.CurrTypeCode);

            //Tab 5: คำอธิบายรายวิชา
            htmlGenerateTab5(data.MajorCode, data.CurrFormatCode, data.TotalCredits, data.YearVersion, data.CurrTypeCode);
        }

        Label20.Text = curriculum.NumYear + " ปี / " + curriculum.MaxNumYear + " ปี";

        //อาจารย์ผู้รับผิดชอบหลักสูตร
        //ความหมาย LOADTYPECODE
        //1	อาจารย์ประจำหลักสูตร
        //4	อาจารย์ประจำแขนง
        string sqlLecturer = "Select * From ABOUTLECTURER Where CURRCODE='" + CurrCode + "' And YEARVERSION='" + YearVersion + "' And LOADTYPECODE='1' Order By LECTIDENTITY";
        List <AboutLecturer> aboutLecturer = new AboutLecturer().getAboutLecturerManual(sqlLecturer);
        int i = 1;

        foreach (AboutLecturer data in aboutLecturer)
        {
            SysUser          sysUser  = new SysUser().getSysUser(data.LectIdentity);
            AcademicPosition position = new AcademicPosition().getAcademicPosition(sysUser.AcademicPositionCode);

            Label21.Text += "<span class=\"report-indent-1em\">" + i + ". " + position.AcademicPositionThName + sysUser.ThName + " " + sysUser.ThSurName + "</span><BR>";
            i++;
        }

        //Export to PDF
        utility utname = new utility();

        Response.ContentType = "application/pdf";
        Response.AddHeader("content-disposition",
                           "attachment;filename=" + CurrCode + ".pdf");
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        StringWriter   sw = new StringWriter();
        HtmlTextWriter hw = new HtmlTextWriter(sw);

        dvHtml.RenderControl(hw);

        StringReader sr     = new StringReader(sw.ToString());
        Document     pdfDoc = new Document(PageSize.A4, 50f, 50f, 50f, 50f);
        //Document pdfDoc = new Document(PageSize.A4.Rotate(), 50f, 50f, 10f, 10f);
        HTMLWorker htmlparser = new HTMLWorker(pdfDoc);

        PdfWriter.GetInstance(pdfDoc, Response.OutputStream);

        pdfDoc.Open();

        StyleSheet styles = new StyleSheet();

        FontFactory.Register(Server.MapPath("~/Fonts/") + "THSarabunNew.ttf");
        styles.LoadTagStyle("body", HtmlTags.FACE, "THSarabunNew");
        styles.LoadTagStyle("body", "size", "16pt");
        styles.LoadTagStyle("body", "encoding", BaseFont.IDENTITY_H);

        styles.LoadTagStyle(HtmlTags.TABLE, "width", "100%");
        styles.LoadTagStyle(HtmlTags.TABLE, "align", "center");
        styles.LoadTagStyle(HtmlTags.TABLE, HtmlTags.BORDER, "0");
        styles.LoadTagStyle(HtmlTags.TH, HtmlTags.BORDER, "0");
        styles.LoadTagStyle(HtmlTags.TD, HtmlTags.BORDER, "0");

        htmlparser.SetStyleSheet(styles);

        htmlparser.Parse(sr);
        pdfDoc.Close();
        Response.Write(pdfDoc);
        Response.End();
        //End Export to PDF
    }