public ProtectStudentData getProtectStudent(string short_code) { ProtectStudentData protectStdData = new ProtectStudentData(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); oracleObj.SelectCommand = "Select * From PROTECT_STD_STATUS Where PRO_STATUS_SHORT='" + short_code + "'"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { protectStdData.ProtectStudent_Code = rowData["PRO_STATUS_CODE"].ToString(); protectStdData.ProtectStudent_Short = rowData["PRO_STATUS_SHORT"].ToString(); protectStdData.ProtectStudent_Thai = rowData["PRO_STATUS_THAI"].ToString(); protectStdData.ProtectStudent_Eng = rowData["PRO_STATUS_ENG"].ToString(); protectStdData.LateFlag = rowData["LATE_FLAG"].ToString(); } return(protectStdData); }
public List <ProtectStudentData> getProtectStudentOnlyLate() { List <ProtectStudentData> protectStdData = new List <ProtectStudentData>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); oracleObj.SelectCommand = "Select * From PROTECT_STD_STATUS Where LATE_FLAG='1' Order By PRO_STATUS_CODE"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { ProtectStudentData protectStd_data = new ProtectStudentData(); protectStd_data.ProtectStudent_Code = rowData["PRO_STATUS_CODE"].ToString(); protectStd_data.ProtectStudent_Short = rowData["PRO_STATUS_SHORT"].ToString(); protectStd_data.ProtectStudent_Thai = rowData["PRO_STATUS_THAI"].ToString(); protectStd_data.ProtectStudent_Eng = rowData["PRO_STATUS_ENG"].ToString(); protectStd_data.LateFlag = rowData["LATE_FLAG"].ToString(); protectStdData.Add(protectStd_data); } return(protectStdData); }