예제 #1
0
 public static CustomerDA getInstance()
 {
     if (instance == null)
     {
         instance = new CustomerDA();
     }
     return(instance);
 }
예제 #2
0
        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();
            }
        }
예제 #3
0
 public bool update()
 {
     return(CustomerDA.getInstance().updateToDatabase(this));
 }
예제 #4
0
 public bool create()
 {
     return(CustomerDA.getInstance().addToDatabase(this));
 }