public static CustomerDA getInstance() { if (instance == null) { instance = new CustomerDA(); } return(instance); }
public void viewCustomerData(int customerID) { modelCustomer = CustomerDA.getInstance().readFromDatabase(customerID); if (modelCustomer != null) { viewCustomer.CustomerName.Text = modelCustomer.Name; viewCustomer.CustomerShortName.Text = modelCustomer.ShortName; viewCustomer.CustomerAddress.Text = modelCustomer.Address; viewCustomer.CustomerEmail.Text = modelCustomer.Email; viewCustomer.CustomerPhone.Text = modelCustomer.PhoneNo; viewCustomer.CustomerAccManager.Text = modelCustomer.AccountManager; } else { //MessageBox.Show("No Customer with ID " + this.selectedCustomerID); //this.Close(); } }
public bool update() { return(CustomerDA.getInstance().updateToDatabase(this)); }
public bool create() { return(CustomerDA.getInstance().addToDatabase(this)); }