public ScholarshipEstduentLoan getEScholarshipLoan(string stdId, string schCode, string AcadmicYear, string Semester) { ScholarshipEstduentLoan scholarshipData = new ScholarshipEstduentLoan(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); oracleObj.SelectCommand = "SELECT * FROM SCHOLARSHIP_ESTUDENT_LOAN WHERE STUDENT_ID = '" + stdId + "' AND SCHOLARSHIP_CODE = '" + schCode + "' AND ACADEMIC_YEAR = '" + AcadmicYear + "' AND SEMESTER = '" + Semester + "'"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_STUDENT_ID = rowData["STUDENT_ID"].ToString(); scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_NATION_ID = rowData["NATION_ID"].ToString(); scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_CONTRACT_NUMBER = rowData["CONTRACT_NUMBER"].ToString(); scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_CONFIRMATION_NUMBER = rowData["CONFIRMATION_NUMBER"].ToString(); scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_DATE_APPROVE = rowData["DATE_APPROVE"].ToString(); scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_LOAN_STUDY = rowData["LOAN_STUDY"].ToString(); scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_LOAN_ETC = rowData["LOAN_ETC"].ToString(); scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_LOAN_LIVE = rowData["LOAN_LIVE"].ToString(); scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_LOAN_TOTAL = rowData["LOAN_TOTAL"].ToString(); scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_SCHOLARSHIP_CODE = rowData["SCHOLARSHIP_CODE"].ToString(); scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_STUDY_YEAR = rowData["STUDY_YEAR"].ToString(); scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_ACADEMIC_YEAR = rowData["ACADEMIC_YEAR"].ToString(); scholarshipData.SCHOLARSHIP_ESTUDENT_LOAN_SEMESTER = rowData["SEMESTER"].ToString(); } return(scholarshipData); }
public string updateEScholarshipLoan(ScholarshipEstduentLoan dataInsert, string schCode, string AcadmicYear, string Semester) { string response = ""; UserLoginData loginData = new UserLoginData(); loginData = (UserLoginData)HttpContext.Current.Session["login_data"]; LogData log_data = new LogData(); log_data.ModuleCode = new LogData().Module_Scholarship; log_data.Username = loginData.User_ID; log_data.Message = "Update ScholarshipEstduentLoan with: " + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_STUDENT_ID + ", " + schCode + ", " + AcadmicYear + ", " + Semester; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); string sql = "Update SCHOLARSHIP_ESTUDENT_LOAN Set CONTRACT_NUMBER = '" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_CONTRACT_NUMBER + "',CONFIRMATION_NUMBER = '" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_CONFIRMATION_NUMBER + "',DATE_APPROVE = '" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_DATE_APPROVE + "',LOAN_STUDY = '" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_LOAN_STUDY + "',LOAN_ETC = '" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_LOAN_ETC + "',LOAN_LIVE = '" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_LOAN_LIVE + "',LOAN_TOTAL = '" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_LOAN_TOTAL + "',SCHOLARSHIP_CODE = '" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_SCHOLARSHIP_CODE + "',STUDY_YEAR = '" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_STUDY_YEAR + "',ACADEMIC_YEAR = '" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_ACADEMIC_YEAR + "',SEMESTER = '" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_SEMESTER + "'Where STUDENT_ID = '" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_STUDENT_ID + "' AND SCHOLARSHIP_CODE = '" + schCode + "' AND ACADEMIC_YEAR = '" + AcadmicYear + "' AND SEMESTER = '" + Semester + "'"; oracleObj.UpdateCommand = sql; try { if (oracleObj.Update() == 1) { response = "OK"; log_data.StatusCode = log_data.LogStatus_SUCCESS; } else { log_data.StatusCode = log_data.LogStatus_FAILED; } } catch (Exception e) { response = e.Message.ToString() + " "; log_data.StatusCode = log_data.LogStatus_ERROR; log_data.Message += " [" + e.ToString() + "]"; } new Log().WriteLog(log_data); return(response); }
public string insertEScholarshipLoan(ScholarshipEstduentLoan dataInsert) { string response = ""; UserLoginData loginData = new UserLoginData(); loginData = (UserLoginData)HttpContext.Current.Session["login_data"]; LogData log_data = new LogData(); log_data.ModuleCode = new LogData().Module_Scholarship; log_data.Username = loginData.User_ID; log_data.Message = "Insert ScholarshipEstduentLoan with: " + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_STUDENT_ID + ", " + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_SCHOLARSHIP_CODE; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); string sql = ""; sql = "Insert Into SCHOLARSHIP_ESTUDENT_LOAN(STUDENT_ID, NATION_ID, CONTRACT_NUMBER, CONFIRMATION_NUMBER, DATE_APPROVE, LOAN_STUDY, LOAN_ETC, LOAN_LIVE, LOAN_TOTAL, SCHOLARSHIP_CODE, STUDY_YEAR, ACADEMIC_YEAR, SEMESTER) Values('" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_STUDENT_ID + "','" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_NATION_ID + "','" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_CONTRACT_NUMBER + "','" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_CONFIRMATION_NUMBER + "','" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_DATE_APPROVE + "','" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_LOAN_STUDY + "','" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_LOAN_ETC + "','" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_LOAN_LIVE + "','" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_LOAN_TOTAL + "','" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_SCHOLARSHIP_CODE + "','" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_STUDY_YEAR + "','" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_ACADEMIC_YEAR + "','" + dataInsert.SCHOLARSHIP_ESTUDENT_LOAN_SEMESTER + "')"; oracleObj.InsertCommand = sql; try { if (oracleObj.Insert() == 1) { response = "OK"; log_data.StatusCode = log_data.LogStatus_SUCCESS; } else { log_data.StatusCode = log_data.LogStatus_FAILED; } } catch (Exception e) { response = e.Message.ToString() + " "; log_data.StatusCode = log_data.LogStatus_ERROR; log_data.Message += " [" + e.ToString() + "]"; } new Log().WriteLog(log_data); return(response); }