// V 1.0.0 public List <RoundPaidData> getNotExpireRoundPaid(string academic_year, string semester, string faculty_code, string degree_char) { List <RoundPaidData> RoundData = new List <RoundPaidData>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); oracleObj.SelectCommand = "Select * From Round_Paid Where ACADEMIC_YEAR='" + academic_year + "' AND SEMESTER='" + semester + "' AND Faculty_Code='" + faculty_code + "' AND DEGREE_CHAR='" + degree_char + "' Order By ROUND"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { utility utlObj = new utility(); string due_date = rowData["DUE_DATE"].ToString(); int diff_date = utlObj.getDiffDate(due_date, utlObj.getToday()); if (diff_date >= 0) { RoundPaidData round_data = new RoundPaidData(); round_data.Academic_Year = rowData["ACADEMIC_YEAR"].ToString(); round_data.Semester = rowData["SEMESTER"].ToString(); round_data.Faculty_Code = rowData["FACULTY_CODE"].ToString(); round_data.Degree_Char = rowData["DEGREE_CHAR"].ToString(); round_data.RoundPaid = Convert.ToInt16(rowData["ROUND"].ToString()); round_data.Start_Date = rowData["START_DATE"].ToString(); round_data.Due_Date = rowData["DUE_DATE"].ToString(); RoundData.Add(round_data); } } return(RoundData); }
// V 1.0.0 public string delRoundPaid(RoundPaidData delData) { string response = ""; Qualified_Student qualified_student = new Qualified_Student(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); //string qualified_std_table = new Qualified_Student().getTableName(delData.Degree_Char); //string sql_chk = "Select * From " + qualified_std_table + " Where YEAR_ADMISSION = '" + new SystemConfig().getConfig().AcademicYear + "' AND SEMESTER_ADMISSION = '" + new SystemConfig().getConfig().Semester + "' AND FACULTY_CODE='" + delData.Faculty_Code + "' AND ROUND_PAID=" + delData.RoundPaid; //qualified_student = new Qualified_Student().getManualOneQualifiedStudent(sql_chk); //if (qualified_student.Faculty_Code == null) //{ string sql = "Delete From Round_Paid Where ACADEMIC_YEAR='" + delData.Academic_Year + "' And SEMESTER='" + delData.Semester + "' And FACULTY_CODE='" + delData.Faculty_Code + "' And DEGREE_CHAR='" + delData.Degree_Char + "' And ROUND=" + delData.RoundPaid; oracleObj.DeleteCommand = sql; try { if (oracleObj.Delete() > 0) { response = "OK"; } } catch (Exception e) { response = e.Message.ToString(); } //} //else //{ // response = "ไม่สามารถลบรอบการชำระเงินได้"; // } return(response); }
// V 1.0.0 public string editRoundPaid(RoundPaidData editData) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); string sql = "Update Round_Paid SET DUE_DATE='" + editData.Due_Date + "', START_DATE='" + editData.Start_Date + "' Where ACADEMIC_YEAR='" + editData.Academic_Year + "' And SEMESTER='" + editData.Semester + "' And FACULTY_CODE='" + editData.Faculty_Code + "' And DEGREE_CHAR='" + editData.Degree_Char + "' And ROUND=" + editData.RoundPaid; oracleObj.UpdateCommand = sql; try { if (oracleObj.Update() == 1) { response = "OK"; } } catch (Exception e) { response = e.Message.ToString(); } return(response); }
// V 1.0.0 public string insertRoundPaid(RoundPaidData insertData) { string response = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); string sql = "Insert Into Round_Paid(DEGREE_CHAR,ACADEMIC_YEAR,SEMESTER,FACULTY_CODE,ROUND,DUE_DATE,START_DATE) Values('" + insertData.Degree_Char + "','" + insertData.Academic_Year + "','" + insertData.Semester + "','" + insertData.Faculty_Code + "'," + insertData.RoundPaid + ",'" + insertData.Due_Date + "','" + insertData.Start_Date + "')"; oracleObj.InsertCommand = sql; try { if (oracleObj.Insert() == 1) { response = "OK"; } } catch (Exception e) { response = e.Message.ToString(); } return(response); }