mirror of
https://github.com/dyiop/astute.git
synced 2025-04-06 21:30:20 -04:00
Add files via upload
This commit is contained in:
parent
3c9484eb9c
commit
27d7316660
|
@ -132,6 +132,8 @@ public abstract class DAO {
|
||||||
|
|
||||||
public abstract List<Customer> getCustomers(String customerId) throws AstuteException;
|
public abstract List<Customer> getCustomers(String customerId) throws AstuteException;
|
||||||
|
|
||||||
|
public abstract Customer getCustomer(String poNumber) throws AstuteException;
|
||||||
|
|
||||||
public abstract String createCustomer(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 String createCustomer(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 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 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;
|
||||||
|
|
|
@ -606,7 +606,31 @@ public class SqlDAO extends DAO {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new AstuteException(DB_ERROR,e.getMessage());
|
throw new AstuteException(DB_ERROR,e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCustomerId(String poNumber) throws AstuteException {
|
||||||
|
String sql = "select po.customer_id from po " +
|
||||||
|
"where po.po_num = '" + poNumber + "'";
|
||||||
|
String custId = null;
|
||||||
|
try {
|
||||||
|
Statement stmt = conn.createStatement();
|
||||||
|
ResultSet resultSet = stmt.executeQuery(sql);
|
||||||
|
|
||||||
|
if(resultSet.next()) {
|
||||||
|
custId = resultSet.getString(1);
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new AstuteException(DB_ERROR,e.getMessage());
|
||||||
|
}
|
||||||
|
return custId;
|
||||||
|
}
|
||||||
|
public Customer getCustomer(String poNumber) throws AstuteException {
|
||||||
|
String customerId = getCustomerId(poNumber);
|
||||||
|
List<Customer> customers = getCustomers(customerId);
|
||||||
|
return customers.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String createCustomer(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 String createCustomer(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 {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user