Add files via upload

This commit is contained in:
gopi17701 2018-09-23 18:44:07 -04:00 committed by GitHub
parent 08b6c9909b
commit 58f6d15e80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -140,6 +140,8 @@ public abstract class DAO {
public abstract void updateCustomer(String customerId, String customerName, String billToDept, String add1, String add2, String city, String state, int zip, int ziplast4, String email, String phone, String fax) throws AstuteException;
public abstract List<PaymentStatus> getPaymentStatuses() throws AstuteException;
// User and session method implementation
public abstract ResultSet executeQuery(String sessionId, String sql) throws AstuteException ;

View File

@ -298,6 +298,26 @@ public class SqlDAO extends DAO {
throw new AstuteException(DB_ERROR,e.getMessage());
}
}
public List<PaymentStatus> getPaymentStatuses() throws AstuteException {
try {
List<PaymentStatus> paymentStatuses = new ArrayList<PaymentStatus>();
Statement stmt = conn.createStatement();
String sql = "SELECT payment_status_id, payment_status_desc FROM payment_status ORDER BY 1 ";
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
int paymentStatusId = rs.getInt(1);
String desc = rs.getString(2);
PaymentStatus paymentStatus = new PaymentStatus(paymentStatusId, desc);
paymentStatuses.add(paymentStatus);
}
return paymentStatuses;
} catch (SQLException e) {
e.printStackTrace();
throw new AstuteException(DB_ERROR,e.getMessage());
}
}
public GeneratedInvoice getGeneratedInvoice(String invoiceNumber) throws AstuteException{
GeneratedInvoice generatedInvoice = null;
Invoice invoice = getInvoiceMaster(invoiceNumber, 0).get(0);