public static int deleteWard(Ward ward) throws ClassNotFoundException, SQLException { String query = "Delete from Ward where WardName='" + ward.getWardName() + "'"; Connection connection = DBConnection.getConnectionToDB(); int res = DBHandler.setData(connection, query); return res; }
public static int deleteReturnedLog(String returnID) throws ClassNotFoundException, SQLException { String query = "Delete from ReturnedLog where ReturnedID = '" + returnID + "'"; Connection connection = DBConnection.getConnectionToDB(); int res = DBHandler.setData(connection, query); return res; }
public static ResultSet getReturnedLogbyDate(java.sql.Date date) throws ClassNotFoundException, SQLException { String query = "Select * From ReturnedLog R INNER JOIN BloodPacket B where ReturnedDate='" + date + "' AND R.PacketID=B.PacketID"; Connection connection = DBConnection.getConnectionToDB(); return DBHandler.getData(connection, query); }
public static int updateWard(Ward oldWard, Ward newWard) throws ClassNotFoundException, SQLException { String query = "update Ward set WardName='" + newWard.getWardName() + "' where WardName='" + oldWard.getWardName() + "'"; Connection connection = DBConnection.getConnectionToDB(); int res = DBHandler.setData(connection, query); return res; }
public static int updateReturnedLog(ReturnedLog log) throws ClassNotFoundException, SQLException { String query = "Update ReturnedLog set returnedDate='" + log.getReturnedDate() + "', reason='" + log.getReason() + "' where returnedID='" + log.getReturnedID() + "'"; Connection connection = DBConnection.getConnectionToDB(); int res = DBHandler.setData(connection, query); return res; }
public static int addReturnedLog(ReturnedLog log) throws ClassNotFoundException, SQLException { String query; if (log.getPatientIssueID() != null) { query = "Insert into ReturnedLog(returnedID,returnedDate,packetID,reason,PatientIssueID) values ('" + log.getReturnedID() + "','" + log.getReturnedDate() + "','" + log.getPacketID() + "','" + log.getReason() + "','" + log.getPatientIssueID() + "')"; System.out.println("==============="); System.out.println(log.getReturnedID()); System.out.println("" + log.getReturnedDate()); System.out.println("" + log.getPacketID()); System.out.println("" + log.getReason()); System.out.println("" + log.getPatientIssueID()); System.out.println("==============="); } else { query = "Insert into ReturnedLog(returnedID,returnedDate,packetID,reason,BulkIssueID) values ('" + log.getReturnedID() + "','" + log.getReturnedDate() + "','" + log.getPacketID() + "','" + log.getReason() + "','" + log.getBulkIssueID() + "')"; } Connection connection = DBConnection.getConnectionToDB(); int res = DBHandler.setData(connection, query); return res; }
public static ResultSet getAllWards() throws ClassNotFoundException, SQLException { String query = "Select * From Ward"; Connection connection = DBConnection.getConnectionToDB(); return DBHandler.getData(connection, query); }
public static int addWard(Ward ward) throws ClassNotFoundException, SQLException { String query = "Insert into Ward(WardName) values ('" + ward.getWardName() + "')"; Connection connection = DBConnection.getConnectionToDB(); int res = DBHandler.setData(connection, query); return res; }
public static ResultSet getReturnedLogbyID(String packetID) throws ClassNotFoundException, SQLException { String query = "Select * From ReturnedLog where packetID='" + packetID + "'"; Connection connection = DBConnection.getConnectionToDB(); return DBHandler.getData(connection, query); }
public static ResultSet getResultIDs() throws ClassNotFoundException, SQLException { String query = "Select * From ReturnedLog order by returnedID"; Connection connection = DBConnection.getConnectionToDB(); return DBHandler.getData(connection, query); }