private void homeToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); Home form1 = new Home(); form1.ShowDialog(); this.Close(); }
private void btnLogIn_Click(object sender, EventArgs e) { var userService = new UserService(); if (userService.LogIn(txtUserName.Text, txtPassword.Text)) { var userService2 = new UserService(); Global.UserId = userService2.GetUserId(txtUserName.Text); this.Hide(); Home form = new Home(); form.ShowDialog(); this.Close(); } else { lblInformation.Visible = true; } }
private void btnEdit_Click(object sender, EventArgs e) { var bookService = new BookService(); var newBook = new Book(); newBook.Name = txtName.Text; newBook.Description = txtDescription.Text; newBook.Genre = txtGenre.Text; newBook.Author = txtAuthor.Text; newBook.ImageUrl = txtImageUrl.Text; bookService.Update(newBook, Global.EditBookId); MessageBox.Show("Successfull edited!"); this.Hide(); Home form1 = new Home(); form1.ShowDialog(); this.Close(); }