Raised bills functionality - updating bill status
[habeas.git] / src / habeas / Utility.java
index bc99932..d9a231b 100644 (file)
@@ -482,6 +482,25 @@ public class Utility {
             return null;
         }
     }
+
+    static boolean updateNoticeBillStatus(int client_id, String from_status, 
+            String to_status) {
+        try {
+            Connection conn = DriverManager.getConnection(JDBC + connectionURL);
+            PreparedStatement st = conn.prepareStatement("UPDATE legalnotices"
+                    + " SET BillStatus=? WHERE BillStatus=? AND ClientId=?;");
+            st.setString (1, to_status);
+            st.setString (2, from_status);
+            st.setInt (3, client_id);
+            st.execute();
+            conn.close();
+            return true;
+        } catch (SQLException ex) {
+            Logger.getLogger(Utility.class.getName()).log(Level.SEVERE, null, ex);
+            return false;
+        }
+        
+    }
     public Utility () {
         
     }