// V 1.0.0 public List <HisRegistrationData> get_HisNwRegistration(string academic_year, string semester, string nation_id, string passport_id, string degree_char) { string tableName = getHisRegistrationTable(degree_char); RegisType_Variable reg_type = new RegisType_Variable(); List <HisRegistrationData> HisData = new List <HisRegistrationData>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); // oracleObj.SelectCommand = "Select * From " + tableName + " Where ACADEMIC_YEAR='" + academic_year + "' And SEMESTER='" + semester + "' And NATION_ID='" + nation_id + "' And PASSPORT_ID='" + nation_id + "' And REG_TYPE='" + reg_type.New_StudentRegistration + "' "; oracleObj.SelectCommand = "Select * From " + tableName + " Where ACADEMIC_YEAR='" + academic_year + "' And SEMESTER='" + semester + "' And NATION_ID='" + nation_id + "' And PASSPORT_ID='" + passport_id + "' And REG_TYPE='" + reg_type.New_StudentRegistration + "'"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { HisRegistrationData his_data = new HisRegistrationData(); his_data.date_time = rowData["DATE_TIME"].ToString(); his_data.academic_year = rowData["ACADEMIC_YEAR"].ToString(); his_data.semester = rowData["SEMESTER"].ToString(); his_data.student_id = rowData["STUDENT_ID"].ToString(); his_data.nation_id = rowData["NATION_ID"].ToString(); his_data.passport_id = rowData["PASSPORT_ID"].ToString(); his_data.reg_type = rowData["REG_TYPE"].ToString(); his_data.course_code = rowData["COURSE_CODE"].ToString(); his_data.course_type = rowData["COURSE_TYPE"].ToString(); his_data.sec = Convert.ToInt16(rowData["SEC"].ToString()); his_data.subsec = Convert.ToInt16(rowData["SUBSEC"].ToString()); his_data.credit = Convert.ToInt16(rowData["CREDIT"].ToString()); his_data.fee = Convert.ToInt16(rowData["FEE"].ToString()); his_data.payment_id = rowData["PAYMENT_ID"].ToString(); HisData.Add(his_data); } return(HisData); }
// V 1.0.0 public string update_HisRegistrationStudentID(string academic_year, string semester, string nation_id, string passport_id, string student_id, string degree_char) { string TableName = getHisRegistrationTable(degree_char); string response = ""; RegisType_Variable reg_type = new RegisType_Variable(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); oracleObj.UpdateCommand = "Update " + TableName + " SET STUDENT_ID='" + student_id + "' Where ACADEMIC_YEAR='" + academic_year + "' And SEMESTER='" + semester + "' And NATION_ID='" + nation_id + "' And PASSPORT_ID='" + passport_id + "' And REG_TYPE='" + reg_type.New_StudentRegistration + "' AND STUDENT_ID IS NULL"; try { if (oracleObj.Update() == 1) { response = "OK"; } } catch (Exception e) { response = e.Message.ToString(); } return(response); }