private void ContinueButton_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(nameInput.Text) && !string.IsNullOrWhiteSpace(surnameInput.Text) && !string.IsNullOrWhiteSpace(emailInput.Text) && Verifier.IsValidEmail(emailInput.Text)) { AutomaticFormPosition.SaveFormStatus(this); User = new User { Name = nameInput.Text, Surname = surnameInput.Text, Email = emailInput.Text }; Register?.Invoke(this, new UserRelatedEventArgs { PendingUser = User }); Hide(); } else { if (string.IsNullOrWhiteSpace(nameInput.Text)) { nameLabel.Text = StringConstants.nameRequirement; } if (string.IsNullOrWhiteSpace(surnameInput.Text)) { surnameLabel.Text = StringConstants.surnameRequirement; } if (string.IsNullOrWhiteSpace(emailInput.Text) || !Verifier.IsValidEmail(emailInput.Text)) { emailLabel.Text = StringConstants.emailRequirement; } } }
private void OnExistingUserRecognised(object sender, FaceRecognisedEventArgs e) { AutomaticFormPosition.SaveFormStatus(this); LoggedIn?.Invoke(this, new UserRelatedEventArgs { UserID = e.Label }); //BeginInvoke(new Action(() => Close())); Invoke(new Action(() => Close())); }
private void UI_Load(object sender, EventArgs e) { //loading UI form window parameters AutomaticFormPosition.loadUIFormDelegate(this); // On load show homepage user control containerPanel.Controls.Add(Homepage.Instance); Search.Instance.Dock = DockStyle.Fill; Search.Instance.BringToFront(); // Remove outline on all buttons foreach (Control button in this.Controls) { if (button is Button) { ChangeCursor((Button)button); } } }
private void OnSaveBook(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(titleBox.Text) && !string.IsNullOrWhiteSpace(isbnBox.Text) && !string.IsNullOrWhiteSpace(publisherBox.Text) && !string.IsNullOrWhiteSpace(authorListBox.Text) && !string.IsNullOrWhiteSpace(genreBox.Text) && !string.IsNullOrWhiteSpace(qtyBox.Text)) { BookGenre genres = new BookGenre(); List <int> authors = new List <int>(); int.TryParse(qtyBox.Text, out int qty); foreach (var genre in genreBox.CheckedItems) { genres = genres | (BookGenre)Enum.Parse(typeof(BookGenre), genre.ToString()); } foreach (Author author in authorListBox.SelectedItems) { authors.Add(author.ID); } for (int i = 0; i < qty; i++) { Book = new Book(title: titleBox.Text, isbn: isbnBox.Text, authorID: authors, publisher: publisherBox.Text, genre: genres, description: descriptionBox.Text); NewBook?.Invoke(this, new BookRelatedEventArgs { Book = Book }); } MessageBox.Show(StringConstants.BookRegistered(titleBox.Text, isbnBox.Text)); RefreshAndClear(); } else { MessageBox.Show(StringConstants.missingInfo); } AutomaticFormPosition.SaveFormStatus(this); }
private void UI_FormClosing(object sender, FormClosingEventArgs e) { AutomaticFormPosition.SaveFormStatus(this); Speaker.TellUser(StringConstants.aiGoodbye); this.Controls.Clear(); }
private void LogoutButton_Click(object sender, EventArgs e) { AutomaticFormPosition.SaveFormStatus(this); Close(); }
private void ExistingUserForm_FormClosing(object sender, FormClosingEventArgs e) { AutomaticFormPosition.SaveFormStatus(this); }
private void ExistingUserForm_Load(object sender, EventArgs e) { AutomaticFormPosition.loadingFormDelegate(this); }
//TEMP private void adminButton_Click(object sender, EventArgs e) { AutomaticFormPosition.SaveFormStatus(this); Administrate?.Invoke(this, e); Hide(); }
private void FirstPage_Load(object sender, EventArgs e) { AutomaticFormPosition.loadStartingFormDelegate(this); }
private void FirstPage_FormClosing(object sender, FormClosingEventArgs e) { AutomaticFormPosition.SaveFormStatus(this); Application.Exit(); }
private void AdminForm_Load(object sender, EventArgs e) { AutomaticFormPosition.LoadAutoPosition(this); authorListBox.ClearSelected(); genreBox.ClearSelected(); }
private void ShowFirstPage(object sender, EventArgs e) { AutomaticFormPosition.loadingFormDelegate(FirstPage); FirstPage.Show(); }