/// <summary> /// เรียกดูข้อมูลจากตาราง TQF2SEC3STRUCTURETYPE /// </summary> /// <param name="CurrCode">รหัสหลักสูตร(Curriculum)</param> /// <returns>ข้อมูลจากตาราง TQF2SEC3STRUCTURETYPE</returns> public Tqf2Sec3StructureType getTqf2Sec3StructureType(string CurrCode) { Tqf2Sec3StructureType Tqf2Sec3StructureTypeData = new Tqf2Sec3StructureType(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); oracleObj.SelectCommand = "Select * From TQF2SEC3STRUCTURETYPE Where CURRCODE='" + CurrCode + "'"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { Tqf2Sec3StructureTypeData.CurrCode = rowData["CURRCODE"].ToString(); Tqf2Sec3StructureTypeData.YearVersion = rowData["YEARVERSION"].ToString(); Tqf2Sec3StructureTypeData.CurrFormatCode = rowData["CURRFORMATCODE"].ToString(); Tqf2Sec3StructureTypeData.CurrTypeCode = rowData["CURRTYPECODE"].ToString(); Tqf2Sec3StructureTypeData.MajorCode = rowData["MAJORCODE"].ToString(); Tqf2Sec3StructureTypeData.CategoryCode = rowData["CATEGORYCODE"].ToString(); Tqf2Sec3StructureTypeData.CourseGroupCode = rowData["COURSEGROUPCODE"].ToString(); Tqf2Sec3StructureTypeData.CourseTypeCode = rowData["COURSETYPECODE"].ToString(); Tqf2Sec3StructureTypeData.TypeCredits = rowData["TYPECREDITS"].ToString(); } return(Tqf2Sec3StructureTypeData); }
/// <summary> /// เพิ่มข้อมูลลงตาราง TQF2SEC4CURRICULUMMAPPING /// </summary> /// <param name="dataInsert">TQF2Sec4CurriculumMapping Object</param> /// <returns>Success</returns> public string insertTQF2Sec4CurriculumMapping(TQF2Sec4CurriculumMapping dataInsert) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Insert into TQF2SEC4CURRICULUMMAPPING (CURRCODE,COURSECODE,DOMAINTYPECODE,T2S4SUB1NO,RESPONSESTATUS,YEARVERSION) values ('" + dataInsert.CurrCode + "','" + dataInsert.CourseCode + "','" + dataInsert.DomainTypeCode + "','" + dataInsert.T2S4Sub1No + "','" + dataInsert.ResponseStatus + "','" + dataInsert.YearVersion + "')"; oracleObj.InsertCommand = sql; try { if (oracleObj.Insert() == 1) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "insertTQF2Sec4CurriculumMapping: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// ลบข้อมูลจากตาราง TQF2SEC4CURRICULUMMAPPING /// </summary> /// <param name="sql">SQL Command</param> /// <returns>Success</returns> public string deleteTQF2Sec4CurriculumMappingManual(string sql) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); oracleObj.DeleteCommand = sql; try { if (oracleObj.Delete() > 0) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "deleteTQF2Sec4CurriculumMappingManual: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// เรียกดูข้อมูลจากตาราง TQF2SEC3PLANDETAIL /// </summary> /// <returns>ข้อมูลจากตาราง TQF2SEC3PLANDETAIL</returns> public List <TQF2Sec3PlanDetail> getTQF2Sec3PlanDetail() { List <TQF2Sec3PlanDetail> TQF2Sec3PlanDetailData = new List <TQF2Sec3PlanDetail>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); oracleObj.SelectCommand = "Select * From TQF2SEC3PLANDETAIL Order By CURRCODE"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { TQF2Sec3PlanDetail TQF2Sec3PlanDetailRow = new TQF2Sec3PlanDetail(); TQF2Sec3PlanDetailRow.T2S3No = rowData["T2S3NO"].ToString(); TQF2Sec3PlanDetailRow.CurrCode = rowData["CURRCODE"].ToString(); TQF2Sec3PlanDetailRow.YearVersion = rowData["YEARVERSION"].ToString(); TQF2Sec3PlanDetailRow.CurrFormatCode = rowData["CURRFORMATCODE"].ToString(); TQF2Sec3PlanDetailRow.CurrTypeCode = rowData["CURRTYPECODE"].ToString(); TQF2Sec3PlanDetailRow.MajorCode = rowData["MAJORCODE"].ToString(); TQF2Sec3PlanDetailRow.CourseGroupCode = rowData["COURSEGROUPCODE"].ToString(); TQF2Sec3PlanDetailRow.CategoryCode = rowData["CATEGORYCODE"].ToString(); TQF2Sec3PlanDetailRow.CourseTypeCode = rowData["COURSETYPECODE"].ToString(); TQF2Sec3PlanDetailRow.CourseCode = rowData["COURSECODE"].ToString(); TQF2Sec3PlanDetailRow.EducationYear = rowData["EDUCATIONYEAR"].ToString(); TQF2Sec3PlanDetailRow.EducationSemester = rowData["EDUCATIONSEMESTER"].ToString(); //TQF2Sec3PlanDetailRow.SUFlag = rowData["SUFLAG"].ToString(); //TQF2Sec3PlanDetailRow.MinCredits = rowData["MINCREDITS"].ToString(); //TQF2Sec3PlanDetailRow.Comments = rowData["COMMENTS"].ToString(); TQF2Sec3PlanDetailData.Add(TQF2Sec3PlanDetailRow); } return(TQF2Sec3PlanDetailData); }
/// <summary> /// เรียกดูข้อมูลจากตาราง TQF2SEC4CURRICULUMMAPPING /// </summary> /// <param name="CurrCode">รหัสหลักสูตร(Curriculum)</param> /// <param name="CourseCode">รหัสวิชา(Course)</param> /// <param name="YearVersion">รหัสเวอร์ชั่นหลักสูตร(Curriculum)</param> /// <returns></returns> public List <TQF2Sec4CurriculumMapping> getTQF2Sec4CurriculumMapping(string CurrCode, string CourseCode, string DomainTypeCode, string YearVersion) { List <TQF2Sec4CurriculumMapping> TQF2Sec4CurriculumMappingData = new List <TQF2Sec4CurriculumMapping>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); oracleObj.SelectCommand = "Select * From TQF2SEC4CURRICULUMMAPPING Where CURRCODE='" + CurrCode + "' And COURSECODE='" + CourseCode + "' And DOMAINTYPECODE='" + DomainTypeCode + "' And YEARVERSION='" + YearVersion + "'"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { TQF2Sec4CurriculumMapping TQF2Sec4CurriculumMappingRow = new TQF2Sec4CurriculumMapping(); TQF2Sec4CurriculumMappingRow.CurrCode = rowData["CURRCODE"].ToString(); TQF2Sec4CurriculumMappingRow.CourseCode = rowData["COURSECODE"].ToString(); TQF2Sec4CurriculumMappingRow.DomainTypeCode = rowData["DOMAINTYPECODE"].ToString(); TQF2Sec4CurriculumMappingRow.T2S4Sub1No = rowData["T2S4SUB1NO"].ToString(); TQF2Sec4CurriculumMappingRow.ResponseStatus = rowData["RESPONSESTATUS"].ToString(); TQF2Sec4CurriculumMappingRow.YearVersion = rowData["YEARVERSION"].ToString(); TQF2Sec4CurriculumMappingData.Add(TQF2Sec4CurriculumMappingRow); } return(TQF2Sec4CurriculumMappingData); }
/// <summary> /// เพิ่มข้อมูลลงตาราง LECTURERPUBLICATION /// </summary> /// <param name="dataInsert">LecturerPublication Object</param> /// <returns>Success</returns> public string insertLecturerPublication(LecturerPublication dataInsert) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Insert into LECTURERPUBLICATION (LECTIDENTITY, PUBLICATIONNAME, PUBLICATIONTYPE, PROCEEDING, PUBLISHEDYEAR, PUBLICATIONID) values ('" + dataInsert.LectIdentity + "','" + dataInsert.PublicationName + "','" + dataInsert.PublicationType + "','" + dataInsert.Ppoceeding + "','" + dataInsert.PublishedYear + "','" + dataInsert.PublicationId + "')"; oracleObj.InsertCommand = sql; try { if (oracleObj.Insert() == 1) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "insertLecturerPublication: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// แก้ไขข้อมูลจากตาราง LECTURERPUBLICATION /// </summary> /// <param name="updateData">LecturerPublication Object</param> /// <returns>Success</returns> public string updateLecturerPublication(LecturerPublication updateData) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Update LECTURERPUBLICATION Set PUBLICATIONNAME = '" + updateData.PublicationName + "', PUBLICATIONTYPE = '" + updateData.PublicationType + "', PROCEEDING = '" + updateData.Ppoceeding + "', PUBLISHEDYEAR = '" + updateData.PublishedYear + "' Where PUBLICATIONID = '" + updateData.PublicationId + "'"; oracleObj.UpdateCommand = sql; try { if (oracleObj.Update() == 1) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "updateLecturerPublication: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// เรียกดูข้อมูลจากตาราง LECTURERBOOK /// </summary> /// <returns>ข้อมูลจากตาราง LECTURERBOOK</returns> public List <LecturerBook> getLecturerBook() { List <LecturerBook> data = new List <LecturerBook>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); oracleObj.SelectCommand = "Select * From LECTURERBOOK Order By LECTIDENTITY"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { LecturerBook row = new LecturerBook(); row.LectIdentity = rowData["LECTIDENTITY"].ToString(); row.BookName = rowData["BOOKNAME"].ToString(); row.Publisher = rowData["PUBLISHER"].ToString(); row.PublishedYear = rowData["PUBLISHEDYEAR"].ToString(); row.BookId = rowData["BOOKID"].ToString(); data.Add(row); } return(data); }
/// <summary> /// เรียกดูข้อมูลจากตาราง STRUCTUREPLAN /// </summary> /// <param name="sql">SQL Command</param> /// <returns>ข้อมูลจากตาราง STRUCTUREPLAN</returns> public List <StructurePlan> getStructurePlanManual(string sql) { List <StructurePlan> StructurePlandata = new List <StructurePlan>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); oracleObj.SelectCommand = sql; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { StructurePlan StructurePlanRow = new StructurePlan(); StructurePlanRow.CurrCode = rowData["CURRCODE"].ToString(); StructurePlanRow.YearVersion = rowData["YEARVERSION"].ToString(); StructurePlanRow.CurrFormatCode = rowData["CURRFORMATCODE"].ToString(); StructurePlanRow.CurrTypeCode = rowData["CURRTYPECODE"].ToString(); StructurePlanRow.MajorCode = rowData["MAJORCODE"].ToString(); StructurePlanRow.StructureType = rowData["STRUCTURETYPE"].ToString(); StructurePlanRow.TotalCredits = rowData["TOTALCREDITS"].ToString(); StructurePlandata.Add(StructurePlanRow); } return(StructurePlandata); }
/// <summary> /// เพิ่มข้อมูลลงตาราง LECTURERBOOK /// </summary> /// <param name="dataInsert">LecturerBook Object</param> /// <returns>Success</returns> public string insertLecturerBook(LecturerBook dataInsert) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Insert into LECTURERBOOK (LECTIDENTITY, BOOKNAME, PUBLISHER, PUBLISHEDYEAR, BOOKID) values ('" + dataInsert.LectIdentity + "','" + dataInsert.BookName + "','" + dataInsert.Publisher + "','" + dataInsert.PublishedYear + "','" + dataInsert.BookId + "')"; oracleObj.InsertCommand = sql; try { if (oracleObj.Insert() == 1) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "insertLecturerBook: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// แก้ไขข้อมูลจากตาราง LECTURERBOOK /// </summary> /// <param name="updateData">LecturerBook Object</param> /// <returns>Success</returns> public string updateLecturerBook(LecturerBook updateData) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Update LECTURERBOOK Set BOOKNAME = '" + updateData.BookName + "', PUBLISHER = '" + updateData.Publisher + "', PUBLISHEDYEAR = '" + updateData.PublishedYear + "' Where BOOKID = '" + updateData.BookId + "'"; oracleObj.UpdateCommand = sql; try { if (oracleObj.Update() == 1) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "updateLecturerBook: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// เรียกดูข้อมูลจากตาราง LECTURERSHOLARSHIP /// </summary> /// <returns>ข้อมูลจากตาราง LECTURERSHOLARSHIP</returns> public List <LecturerSholarship> getLecturerSholarship() { List <LecturerSholarship> data = new List <LecturerSholarship>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); oracleObj.SelectCommand = "Select * From LECTURERSHOLARSHIP Order By LECTIDENTITY"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { LecturerSholarship row = new LecturerSholarship(); row.LectIdentity = rowData["LECTIDENTITY"].ToString(); row.ScholarYear = rowData["SCHOLARYEAR"].ToString(); row.ScholarName = rowData["SCHOLARNAME"].ToString(); row.ScholarPurpose = rowData["SCHOLARPURPOSE"].ToString(); row.ScholarshipId = rowData["SCHOLARSHIPID"].ToString(); data.Add(row); } return(data); }
/// <summary> /// แก้ไขข้อมูลจากตาราง LECTURERSHOLARSHIP /// </summary> /// <param name="updateData">LecturerSholarship Object</param> /// <returns>Success</returns> public string updateLecturerSholarship(LecturerSholarship updateData) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Update LECTURERSHOLARSHIP Set SCHOLARYEAR = '" + updateData.ScholarYear + "', SCHOLARNAME = '" + updateData.ScholarName + "', SCHOLARPURPOSE = '" + updateData.ScholarPurpose + "' Where SCHOLARSHIPID = '" + updateData.ScholarshipId + "'"; oracleObj.UpdateCommand = sql; try { if (oracleObj.Update() == 1) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "updateLecturerSholarship: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// เพิ่มข้อมูลลงตาราง LECTURERSHOLARSHIP /// </summary> /// <param name="dataInsert">LecturerSholarship Object</param> /// <returns>Success</returns> public string insertLecturerSholarship(LecturerSholarship dataInsert) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Insert into LECTURERSHOLARSHIP (LECTIDENTITY, SCHOLARYEAR, SCHOLARNAME, SCHOLARPURPOSE, SCHOLARSHIPID) values ('" + dataInsert.LectIdentity + "','" + dataInsert.ScholarYear + "','" + dataInsert.ScholarName + "','" + dataInsert.ScholarPurpose + "','" + dataInsert.ScholarshipId + "')"; oracleObj.InsertCommand = sql; try { if (oracleObj.Insert() == 1) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "insertLecturerSholarship: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// ลบข้อมูลจากตาราง TQF2SEC4SUB1 /// </summary> /// <param name="T2S4Sub1No">รหัสการพัฒนาคุณลักษณะพิเศษของนักศึกษา</param> /// <returns>Success</returns> public string deleteTQF2Sec4Sub1(string T2S4Sub1No) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Delete From TQF2SEC4SUB1 Where T2S4SUB1NO ='" + T2S4Sub1No + "'"; oracleObj.DeleteCommand = sql; try { if (oracleObj.Delete() > 0) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "deleteTQF2Sec4Sub1: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// เพิ่มข้อมูลลงตาราง STRUCTUREPLAN /// </summary> /// <param name="dataInsert">StructurePlan Object</param> /// <returns>Success</returns> public string insertStructurePlan(StructurePlan dataInsert) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Insert into STRUCTUREPLAN (CURRCODE, YEARVERSION, CURRFORMATCODE, CURRTYPECODE, MAJORCODE, STRUCTURETYPE, TOTALCREDITS) values ('" + dataInsert.CurrCode + "','" + dataInsert.YearVersion + "','" + dataInsert.CurrFormatCode + "','" + dataInsert.CurrTypeCode + "','" + dataInsert.MajorCode + "','" + dataInsert.StructureType + "','" + dataInsert.TotalCredits + "')"; oracleObj.InsertCommand = sql; try { if (oracleObj.Insert() == 1) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "insertStructurePlan: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// แก้ไขข้อมูลจากตาราง TQF2SEC4SUB1 /// เฉพาะข้อมูล colum DETAIL เท่านั้น /// </summary> /// <param name="updateData">TQF2Sec4Sub1 Object</param> /// <returns>Success</returns> public string updateTQF2Sec4Sub1(TQF2Sec4Sub1 updateData) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); //string sql = "Update TQF2SEC4SUB1 Set CURRCODE = '" + updateData.CurrCode + "', DOMAINTYPECODE = '" + updateData.DomainTypeCode + "', DETAILTYPE = '" + updateData.DetailType + "', DETAIL = '" + updateData.Detail + "', YEARVERSION = '" + updateData.YearVersion + "' Where T2S4SUB1NO = '" + updateData.T2S4Sub1No + "'"; string sql = "Update TQF2SEC4SUB1 Set DETAIL = '" + updateData.Detail + "' Where T2S4SUB1NO = '" + updateData.T2S4Sub1No + "'"; oracleObj.UpdateCommand = sql; try { if (oracleObj.Update() == 1) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "updateTQF2Sec4Sub1: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// ลบข้อมูลจากตาราง STRUCTUREPLAN /// </summary> /// <param name="CurrCode">รหัสหลักสูตร(Curriculum)</param> /// <returns>Success</returns> public string deleteStructurePlan(string CurrCode) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Delete From STRUCTUREPLAN Where CURRCODE ='" + CurrCode + "'"; oracleObj.DeleteCommand = sql; try { if (oracleObj.Delete() > 0) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "deleteStructurePlan: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// ลบข้อมูลจากตาราง LECTURERPUBLICATION /// </summary> /// <param name="LectIdentity"></param> /// <returns>Success</returns> public string deleteLecturerPublication(string PublicationId) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Delete From LECTURERPUBLICATION Where LECTIDENTITY ='" + LectIdentity + "'"; oracleObj.DeleteCommand = sql; try { if (oracleObj.Delete() > 0) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "deleteLecturerPublication: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// แก้ไขข้อมูลจากตาราง STRUCTUREPLAN /// </summary> /// <param name="updateData">StructurePlan Object</param> /// <returns>Success</returns> public string updateStructurePlan(StructurePlan updateData) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Update STRUCTUREPLAN Set STRUCTURETYPE = '" + updateData.StructureType + "', TOTALCREDITS = '" + updateData.TotalCredits + "' Where CURRCODE = '" + updateData.CurrCode + "' And YEARVERSION = '" + updateData.YearVersion + "' And CURRFORMATCODE = '" + updateData.CurrFormatCode + "' And CURRTYPECODE = '" + updateData.CurrTypeCode + "' And MAJORCODE = '" + updateData.MajorCode + "'"; oracleObj.UpdateCommand = sql; try { if (oracleObj.Update() == 1) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "updateStructurePlan: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// เรียกดูข้อมูลจากตาราง LECTURERPUBLICATION /// </summary> /// <returns>ข้อมูลจากตาราง LecturerPublication</returns> public List <LecturerPublication> getLecturerPublication() { List <LecturerPublication> data = new List <LecturerPublication>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); oracleObj.SelectCommand = "Select * From LECTURERPUBLICATION Order By LECTIDENTITY"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { LecturerPublication row = new LecturerPublication(); row.LectIdentity = rowData["LECTIDENTITY"].ToString(); row.PublicationName = rowData["PUBLICATIONNAME"].ToString(); row.PublicationType = rowData["PUBLICATIONTYPE"].ToString(); row.Ppoceeding = rowData["PROCEEDING"].ToString(); row.PublishedYear = rowData["PUBLISHEDYEAR"].ToString(); row.PublicationId = rowData["PUBLICATIONID"].ToString(); data.Add(row); } return(data); }
/// <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); }
/// <summary> /// ตรวจสอบการใช้งานวิชาในหลักสูตรต่างๆ /// </summary> /// <param name="CourseCode"></param> /// <returns> /// false = ไม่มีการใช้งานวิชา /// true = มีการใช้งานวิชา /// </returns> public bool existCourse(string CourseCode) { bool result = true; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); try { string sql = "Select * From TQF2SEC3PLANDETAIL Where COURSECODE='" + CourseCode + "'"; oracleObj.SelectCommand = sql; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); if (allData.Count == 0) { result = false; } else { result = true; } } catch { HttpContext.Current.Session["response"] = "Unit Test:TQF2Sec3PlanDetail:existCourse" + " ไม่สามารถดำเนินการได้"; HttpContext.Current.Response.Redirect("err_response.aspx"); } return(result); }
/// <summary> /// ลบข้อมูลจากตาราง ACADEMICPOSITION /// </summary> /// <param name="AcademicPositionCode">รหัสตำแหน่งทางวิชาการ</param> /// <returns>Success</returns> public string deleteAcademicPosition(string AcademicPositionCode) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Delete From ACADEMICPOSITION Where ACADEMICPOSITIONCODE ='" + AcademicPositionCode + "'"; oracleObj.DeleteCommand = sql; try { if (oracleObj.Delete() > 0) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "deleteAcademicPosition: " + exception; HttpContext.Current.Response.Redirect("err_response.aspx"); } return(response); }
/// <summary> /// เรียกดูข้อมูลจากตาราง TQF2SEC4CURRICULUMMAPPING /// </summary> /// <param name="sql">SQL Command</param> /// <returns>ข้อมูลจากตาราง TQF2SEC4CURRICULUMMAPPING</returns> public List <TQF2Sec4CurriculumMapping> getTQF2Sec4CurriculumMappingManual(string sql) { List <TQF2Sec4CurriculumMapping> TQF2Sec4CurriculumMappingData = new List <TQF2Sec4CurriculumMapping>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); oracleObj.SelectCommand = sql; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { TQF2Sec4CurriculumMapping TQF2Sec4CurriculumMappingRow = new TQF2Sec4CurriculumMapping(); TQF2Sec4CurriculumMappingRow.CurrCode = rowData["CURRCODE"].ToString(); TQF2Sec4CurriculumMappingRow.CourseCode = rowData["COURSECODE"].ToString(); TQF2Sec4CurriculumMappingRow.DomainTypeCode = rowData["DOMAINTYPECODE"].ToString(); TQF2Sec4CurriculumMappingRow.T2S4Sub1No = rowData["T2S4SUB1NO"].ToString(); TQF2Sec4CurriculumMappingRow.ResponseStatus = rowData["RESPONSESTATUS"].ToString(); TQF2Sec4CurriculumMappingRow.YearVersion = rowData["YEARVERSION"].ToString(); TQF2Sec4CurriculumMappingData.Add(TQF2Sec4CurriculumMappingRow); } return(TQF2Sec4CurriculumMappingData); }
/// <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); }
/// <summary> /// ลบข้อมูลจากตาราง TQF2SEC4CURRICULUMMAPPING /// </summary> /// <param name="CurrCode">รหัสหลักสูตร(Curriculum)</param> /// <returns>Success</returns> public string deleteTQF2Sec4CurriculumMapping(string CurrCode) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Delete From TQF2SEC4CURRICULUMMAPPING Where CURRCODE ='" + CurrCode + "'"; oracleObj.DeleteCommand = sql; try { if (oracleObj.Delete() > 0) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "deleteTQF2Sec4CurriculumMapping: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// เรียกดูข้อมูลจากตาราง TQF2SEC4SUB1 /// </summary> /// <param name="sql">SQL Command</param> /// <returns>ข้อมูลจากตาราง TQF2SEC4SUB1</returns> public List <TQF2Sec4Sub1> getTQF2Sec4Sub1Manual(string sql) { List <TQF2Sec4Sub1> data = new List <TQF2Sec4Sub1>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); oracleObj.SelectCommand = sql; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { TQF2Sec4Sub1 row = new TQF2Sec4Sub1(); row.T2S4Sub1No = rowData["T2S4SUB1NO"].ToString(); row.CurrCode = rowData["CURRCODE"].ToString(); row.DomainTypeCode = rowData["DOMAINTYPECODE"].ToString(); row.DetailType = rowData["DETAILTYPE"].ToString(); row.Detail = rowData["DETAIL"].ToString(); row.YearVersion = rowData["YEARVERSION"].ToString(); data.Add(row); } return(data); }
/// <summary> /// แก้ไขข้อมูลจากตาราง TQF2Sec4CurriculumMapping /// </summary> /// <param name="updateData">TQF2Sec4CurriculumMappingCategory Object</param> /// <returns>Success</returns> public string updateTQF2Sec4CurriculumMapping(TQF2Sec4CurriculumMapping updateData) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); string sql = "Update TQF2SEC4CURRICULUMMAPPING Set RESPONSESTATUS = '" + updateData.ResponseStatus + "'Where CURRCODE = '" + updateData.CurrCode + "' And COURSECODE = '" + updateData.CourseCode + "' And DOMAINTYPECODE = '" + updateData.DomainTypeCode + "' And T2S4SUB1NO = '" + updateData.T2S4Sub1No + "' And YEARVERSION = '" + updateData.YearVersion + "'"; oracleObj.UpdateCommand = sql; try { if (oracleObj.Update() == 1) { response = "Success"; } } catch (Exception e) { string exception = e.Message; HttpContext.Current.Session["response"] = "updateTQF2Sec4CurriculumMapping: " + exception; HttpContext.Current.Response.Redirect("../err_response.aspx"); } return(response); }
/// <summary> /// เรียกผลรวมหน่วยกิตจากตาราง TQF2SEC3STRUCTURETYPE /// </summary> /// <param name="summaryData">Tqf2Sec3StructureType Object</param> /// <returns></returns> public int getSumStructureType(Tqf2Sec3StructureType summaryData) { int summary = 0; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle_tqf2(); oracleObj.SelectCommand = "select SUM(TYPECREDITS) As SUMCREDITS from TQF2SEC3STRUCTURETYPE Where CURRCODE='" + summaryData.CurrCode + "' And YEARVERSION='" + summaryData.YearVersion + "' And CURRFORMATCODE='" + summaryData.CurrFormatCode + "' And CURRTYPECODE='" + summaryData.CurrTypeCode + "' And MAJORCODE='" + summaryData.MajorCode + "' And CATEGORYCODE='" + summaryData.CategoryCode + "' And COURSEGROUPCODE='" + summaryData.CourseGroupCode + "'"; try { DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { if (rowData["SUMCREDITS"].ToString() == "") { summary = 0; } else { summary = int.Parse(rowData["SUMCREDITS"].ToString()); } } } catch { HttpContext.Current.Session["response"] = "Unit Test:getSumCategoryCredits" + " ไม่สามารถดำเนินการได้"; HttpContext.Current.Response.Redirect("err_response.aspx"); } return(summary); }