private void btnLogin_Click_1(object sender, EventArgs e) { //Validate Email & password combination if (!txtEmail.Text.Equals("") || !txtPassword.Text.Equals("")) { Customer cust = new Customer(); cust.setEmail((txtEmail.Text).ToLower()); cust.setPassword(txtPassword.Text); if (cust.isValidLogin()) { cust.setCustDetails(); pnlBook.Visible = true; txtBal.Text = Convert.ToString(cust.getBal()); txtEmail.Enabled = false; txtPassword.Enabled = false; grdEvents.Enabled = false; btnLogin.Visible = false; Event myEvent = new Event(); //gets the selected rows id myEvent.setTitle(grdEvents.Rows[grdEvents.CurrentCell.RowIndex].Cells[0].Value.ToString()); myEvent.setEventDetails(); Venue venue = new Venue(); venue.setID(myEvent.getVenueId()); venue.setVenueDetails(); lblSelectedEvent.Text = myEvent.getTitle() + " at " + venue.getName(); } else { MessageBox.Show("Your Email or Password is incorrect", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Please enter a valid Email or Password", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); txtEmail.Clear(); txtPassword.Clear(); txtEmail.Focus(); } }
private void grdEvents_CellClick(object sender, DataGridViewCellEventArgs e) { pnlLogin.Visible = true; Event myEvent = new Event(); //gets the selected rows id myEvent.setTitle(grdEvents.Rows[grdEvents.CurrentCell.RowIndex].Cells[0].Value.ToString()); myEvent.setEventDetails(); Venue venue = new Venue(); venue.setID(myEvent.getVenueId()); venue.setVenueDetails(); lblSelectedEvent.Text = myEvent.getTitle() + " at " + venue.getName(); }
private void cboVenueNames_SelectedIndexChanged(object sender, EventArgs e) { pnlUpdateVenue.Visible = true; string selected = cboVenueNames.Text; Venue selectedVenue = new Venue(); selectedVenue.setName(selected); selectedVenue.setVenueDetails(); txtVenueName.Text = selectedVenue.getName(); txtStreet.Text = selectedVenue.getStreet(); txtTown.Text = selectedVenue.getTown(); txtCapacity.Text = Convert.ToString(selectedVenue.getCapacity()); txtContactNo.Text = selectedVenue.getContactNo(); txtEmail.Text = selectedVenue.getEmail(); txtPassword.Text = selectedVenue.getPassword(); }