private void btnCheckIn_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(txtAttendeeEmail.Text)) { MessageBox.Show("Please enter your email address!!!"); txtAttendeeEmail.Focus(); return; } else { string email = txtAttendeeEmail.Text.Trim(); ConventionManagerDbContext db = new ConventionManagerDbContext(); List <Attendee> list = db.Attendees.Where(a => a.AttendeeEmail.Equals(email)).ToList(); if (list.Count == 0) { MessageBox.Show(email + " is not registered!!!"); txtAttendeeEmail.Clear(); txtAttendeeEmail.Focus(); return; } else { this.Hide(); FormLoader.loadAttendeeDetailForm(false, email); this.Close(); } } }
private void AttendeeDetail_FormClosed(object sender, FormClosedEventArgs e) { this.Hide(); if (isAdmin) { FormLoader.loadHome(); } else { FormLoader.loadConventionManager(); } this.Close(); }
private void AddAttendeeToStall_FormClosed(object sender, FormClosedEventArgs e) { this.Hide(); FormLoader.loadHome(); this.Close(); }
private void RoomUsageForm_FormClosed(object sender, FormClosedEventArgs e) { this.Hide(); FormLoader.loadHome(); this.Close(); }
private void lnkAdmin_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (lnkAdmin.Text.Equals("- Admin Login")) { lnkAdmin.Text = "- Attendee Login"; lblIntro.Text = "Admin username:"******"Admin password:"******"Login"; btnAdminLogin.Size = new Size(155, 35); btnAdminLogin.Location = new Point(42, 200); btnAdminLogin.TabIndex = 3; btnAdminLogin.Click += (se, ea) => { if (String.IsNullOrEmpty(txtAttendeeEmail.Text)) { MessageBox.Show("Please enter username!!!"); txtAttendeeEmail.Focus(); return; } else if (String.IsNullOrEmpty(txtPassword.Text)) { MessageBox.Show("Please enter password!!!"); txtPassword.Focus(); return; } else { if (txtAttendeeEmail.Text.Trim().Equals("admin") && txtPassword.Text.Trim().Equals("admin")) { this.Hide(); FormLoader.loadHome(); this.Close(); } else { MessageBox.Show("Login failed !!!"); txtAttendeeEmail.Clear(); txtPassword.Clear(); txtAttendeeEmail.Focus(); return; } } }; gbxConventionManager.Controls.Add(lblPassword); gbxConventionManager.Controls.Add(txtPassword); gbxConventionManager.Controls.Add(btnAdminLogin); txtAttendeeEmail.Focus(); } else { lnkAdmin.Text = "- Admin Login"; lblIntro.Text = "Enter email for attendee check-in"; btnCheckIn.Visible = true; lblPassword.Visible = txtPassword.Visible = btnAdminLogin.Visible = false; txtAttendeeEmail.Focus(); } }