Example #1
0
 public void PopulateCustomerDialog(Customer c, CustomerDialog cd)
 {
     cd.FirstName       = c.FirstName;
     cd.LastName        = c.LastName;
     cd.UserName        = c.UserName;
     cd.Password        = c.Password;
     cd.EMailAddress    = c.Email;
     cd.Address         = c.Address;
     cd.TelephoneNumber = c.Telephone;
 }
 public void PopulateCustomerDialog(ref CustomerDialog cd, Customer cust)
 {
     cd.FirstName       = cust.FirstName;
     cd.LastName        = cust.LastName;
     cd.UserName        = cust.Username;
     cd.Password        = cust.Password;
     cd.EMailAddress    = cust.Email;
     cd.Address         = cust.Address;
     cd.TelephoneNumber = cust.PhoneNumber;
 }
 public void updateCustomerDialog(CustomerDialog cd, ListCustomersDialog lcd)
 {
     cd.FirstName       = listOfCustomers[lcd.SelectedIndex].firstName;
     cd.LastName        = listOfCustomers[lcd.SelectedIndex].lastName;
     cd.UserName        = listOfCustomers[lcd.SelectedIndex].userName;
     cd.Password        = listOfCustomers[lcd.SelectedIndex].password;
     cd.EMailAddress    = listOfCustomers[lcd.SelectedIndex].email;
     cd.Address         = listOfCustomers[lcd.SelectedIndex].address;
     cd.TelephoneNumber = listOfCustomers[lcd.SelectedIndex].phoneNumber;
 }
Example #4
0
 // XXX You may add overriding constructors (constructors with different set of arguments).
 // If you do so, make sure to call :this()
 // public StaffWindow(XXX xxx): this() { }
 // Without :this(), InitializeComponent() is not called
 private void StaffWindow_Load(object sender, EventArgs e)
 {
     listCustomersDialog            = new ListCustomersDialog();
     customerDialog                 = new CustomerDialog();
     listBooksDialog                = new ListBooksDialog();
     bookDialog                     = new BookDialog();
     listCompleteTransactionsDialog = new ListCompleteTransactionsDialog();
     showCompleteTransactionDialog  = new ShowCompleteTransactionDialog();
     listPendingTransactionsDialog  = new ListPendingTransactionsDialog();
     showPendingTransactionDialog   = new ShowPendingTransactionDialog();
 }
 public void EditCustomerInfo(ref CustomerDialog cd, Customer c)
 {
     usernames.Remove(c.Username);
     c.FirstName   = cd.FirstName;
     c.LastName    = cd.LastName;
     c.Username    = cd.UserName;
     c.Password    = cd.Password;
     c.Email       = cd.EMailAddress;
     c.Address     = cd.Address;
     c.PhoneNumber = cd.TelephoneNumber;
     usernames.Add(c.Username);
 }
Example #6
0
 // XXX You may add overriding constructors (constructors with different set of arguments).
 // If you do so, make sure to call :this()
 // public CustomerWindow(XXX xxx): this() { }
 // Without :this(), InitializeComponent() is not called
 private void CustomerWindow_Load(object sender, EventArgs e)
 {
     customerDialog               = new CustomerDialog();
     loginDialog                  = new LoginDialog();
     listBooksDialog              = new ListBooksDialog();
     bookInformationDialog        = new BookInformationDialog();
     cartDialog                   = new CartDialog();
     wishListDialog               = new WishListDialog();
     bookInWishListDialog         = new BookInWishListDialog();
     listTransactionHistoryDialog = new ListTransactionHistoryDialog();
     showTransactionDialog        = new ShowTransactionDialog();
 }
 public void populateCustomerDialog(CustomerDialog customerDialog)
 {
     if (LoggedinCustomer != null)
     {
         customerDialog.FirstName       = LoggedinCustomer.firstName;
         customerDialog.LastName        = LoggedinCustomer.lastName;
         customerDialog.UserName        = LoggedinCustomer.userName;
         customerDialog.Password        = LoggedinCustomer.password;
         customerDialog.EMailAddress    = LoggedinCustomer.email;
         customerDialog.Address         = LoggedinCustomer.address;
         customerDialog.TelephoneNumber = LoggedinCustomer.phoneNumber;
     }
 }
 public void PopulateCustomerDialog(ref CustomerDialog cd)
 {
     if (!loggedOn)
     {
         throw new BookShopException("This operation requires login.");
     }
     cd.FirstName       = currentCustomer.FirstName;
     cd.LastName        = currentCustomer.LastName;
     cd.UserName        = currentCustomer.Username;
     cd.Password        = currentCustomer.Password;
     cd.EMailAddress    = currentCustomer.Email;
     cd.Address         = currentCustomer.Address;
     cd.TelephoneNumber = currentCustomer.PhoneNumber;
 }