1 package projectmanagement.business.customer; 2 3 import projectmanagement.business.ProjectManagementBusinessException; 4 import projectmanagement.data.customer.*; 5 import com.lutris.appserver.server.sql.DatabaseManagerException; 6 import com.lutris.appserver.server.sql.ObjectIdException; 7 import com.lutris.dods.builder.generator.query.DataObjectException; 8 9 import projectmanagement.spec.customer.*; 10 16 public class CustomerImpl implements Customer { 17 20 protected CustomerDO myDO = null; 21 22 25 public CustomerImpl() throws ProjectManagementBusinessException { 26 try { 27 this.myDO = CustomerDO.createVirgin(); 28 } catch(DatabaseManagerException ex) { 29 throw new ProjectManagementBusinessException("Error creating empty customer", ex); 30 } catch(ObjectIdException ex) { 31 throw new ProjectManagementBusinessException("Error creating object ID for customer", ex); 32 } 33 } 34 35 39 public CustomerImpl(CustomerDO theCustomer) { 40 this.myDO = theCustomer; 41 } 42 43 50 public CustomerDO getDO() 51 throws ProjectManagementBusinessException { 52 if (this.myDO!=null) { 53 return this.myDO; 54 } else { 55 throw new ProjectManagementBusinessException("Error getting DO object for customer"); 56 } 57 } 58 59 67 public String getHandle() 68 throws ProjectManagementBusinessException { 69 try { 70 return this.myDO.getHandle(); 71 } catch(DatabaseManagerException ex) { 72 throw new ProjectManagementBusinessException("Error getting handle for customer", ex); 73 } 74 } 75 76 84 public void setCompanyName(String companyName) 85 throws ProjectManagementBusinessException { 86 try { 87 myDO.setCompanyName(companyName); 88 } catch(DataObjectException ex) { 89 throw new ProjectManagementBusinessException("Error setting company name", ex); 90 } 91 } 92 93 101 public String getCompanyName () 102 throws ProjectManagementBusinessException { 103 try { 104 return myDO.getCompanyName(); 105 } catch(DataObjectException ex) { 106 throw new ProjectManagementBusinessException("Error getting company name", ex); 107 } 108 } 109 110 118 public void setContactName(String contactName) 119 throws ProjectManagementBusinessException { 120 try { 121 myDO.setContactName(contactName); 122 } catch(DataObjectException ex) { 123 throw new ProjectManagementBusinessException("Error setting contact name", ex); 124 } 125 } 126 127 135 public String getContactName () 136 throws ProjectManagementBusinessException { 137 try { 138 return myDO.getContactName(); 139 } catch(DataObjectException ex) { 140 throw new ProjectManagementBusinessException("Error getting contact name", ex); 141 } 142 } 143 144 152 public void setContactTitle(String contactTitle) 153 throws ProjectManagementBusinessException { 154 try { 155 myDO.setContactTitle(contactTitle); 156 } catch(DataObjectException ex) { 157 throw new ProjectManagementBusinessException("Error setting contact title", ex); 158 } 159 } 160 161 169 public String getContactTitle() 170 throws ProjectManagementBusinessException { 171 try { 172 return myDO.getContactTitle(); 173 } catch(DataObjectException ex) { 174 throw new ProjectManagementBusinessException("Error getting contact title", ex); 175 } 176 } 177 178 186 public void setAddress(String address) 187 throws ProjectManagementBusinessException { 188 try { 189 myDO.setAddress(address); 190 } catch(DataObjectException ex) { 191 throw new ProjectManagementBusinessException("Error setting address", ex); 192 } 193 } 194 195 203 public String getAddress() 204 throws ProjectManagementBusinessException { 205 try { 206 return myDO.getAddress(); 207 } catch(DataObjectException ex) { 208 throw new ProjectManagementBusinessException("Error getting address", ex); 209 } 210 } 211 212 220 public void setCity(String city) 221 throws ProjectManagementBusinessException { 222 try { 223 myDO.setCity(city); 224 } catch(DataObjectException ex) { 225 throw new ProjectManagementBusinessException("Error setting city", ex); 226 } 227 } 228 229 237 public String getCity() 238 throws ProjectManagementBusinessException { 239 try { 240 return myDO.getCity(); 241 } catch(DataObjectException ex) { 242 throw new ProjectManagementBusinessException("Error getting customer city", ex); 243 } 244 } 245 246 254 public void setRegion(String region) 255 throws ProjectManagementBusinessException { 256 try { 257 myDO.setRegion(region); 258 } catch(DataObjectException ex) { 259 throw new ProjectManagementBusinessException("Error setting region", ex); 260 } 261 } 262 263 271 public String getRegion() 272 throws ProjectManagementBusinessException { 273 try { 274 return myDO.getRegion(); 275 } catch(DataObjectException ex) { 276 throw new ProjectManagementBusinessException("Error getting customer region", ex); 277 } 278 } 279 280 288 public void setPostalCode(String postalCode) 289 throws ProjectManagementBusinessException { 290 try { 291 myDO.setPostalCode(postalCode); 292 } catch(DataObjectException ex) { 293 throw new ProjectManagementBusinessException("Error setting postal code", ex); 294 } 295 } 296 297 305 public String getPostalCode() 306 throws ProjectManagementBusinessException { 307 try { 308 return myDO.getPostalCode(); 309 } catch(DataObjectException ex) { 310 throw new ProjectManagementBusinessException("Error getting customer postal code", ex); 311 } 312 } 313 314 322 public void setCountry(String country) 323 throws ProjectManagementBusinessException { 324 try { 325 myDO.setCountry(country); 326 } catch(DataObjectException ex) { 327 throw new ProjectManagementBusinessException("Error setting country", ex); 328 } 329 } 330 331 339 public String getCountry() 340 throws ProjectManagementBusinessException { 341 try { 342 return myDO.getCountry(); 343 } catch(DataObjectException ex) { 344 throw new ProjectManagementBusinessException("Error getting customer country", ex); 345 } 346 } 347 348 356 public void setPhone(String phone) 357 throws ProjectManagementBusinessException { 358 try { 359 myDO.setPhone(phone); 360 } catch(DataObjectException ex) { 361 throw new ProjectManagementBusinessException("Error setting phone", ex); 362 } 363 } 364 365 373 public String getPhone() 374 throws ProjectManagementBusinessException { 375 try { 376 return myDO.getPhone(); 377 } catch(DataObjectException ex) { 378 throw new ProjectManagementBusinessException("Error getting customer phone", ex); 379 } 380 } 381 382 390 public void setFax(String fax) 391 throws ProjectManagementBusinessException { 392 try { 393 myDO.setFax(fax); 394 } catch(DataObjectException ex) { 395 throw new ProjectManagementBusinessException("Error setting fax", ex); 396 } 397 } 398 399 407 public String getFax() 408 throws ProjectManagementBusinessException { 409 try { 410 return myDO.getFax(); 411 } catch(DataObjectException ex) { 412 throw new ProjectManagementBusinessException("Error getting customer fax", ex); 413 } 414 } 415 416 424 public void setEmail(String email) 425 throws ProjectManagementBusinessException { 426 try { 427 myDO.setEmail(email); 428 } catch(DataObjectException ex) { 429 throw new ProjectManagementBusinessException("Error setting email", ex); 430 } 431 } 432 433 441 public String getEmail() 442 throws ProjectManagementBusinessException { 443 try { 444 return myDO.getEmail(); 445 } catch(DataObjectException ex) { 446 throw new ProjectManagementBusinessException("Error getting customer email", ex); 447 } 448 } 449 450 458 public void setNotes(String notes) 459 throws ProjectManagementBusinessException { 460 try { 461 myDO.setNotes(notes); 462 } catch(DataObjectException ex) { 463 throw new ProjectManagementBusinessException("Error setting notes", ex); 464 } 465 } 466 467 475 public String getNotes() 476 throws ProjectManagementBusinessException { 477 try { 478 return myDO.getNotes(); 479 } catch(DataObjectException ex) { 480 throw new ProjectManagementBusinessException("Error getting customer notes", ex); 481 } 482 } 483 484 491 public void save() throws ProjectManagementBusinessException { 492 try { 493 this.myDO.save(); 494 } catch(Exception ex) { 495 throw new ProjectManagementBusinessException("Error saving customer", ex); 496 } 497 } 498 499 506 public void delete() throws ProjectManagementBusinessException { 507 try { 508 this.myDO.delete(); 509 } catch(Exception ex) { 510 throw new ProjectManagementBusinessException("Error deleting customer", ex); 511 } 512 } 513 514 } 515 | Popular Tags |