コード例 #1
0
        private void homeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            Home form1 = new Home();

            form1.ShowDialog();
            this.Close();
        }
コード例 #2
0
ファイル: LogInForm.cs プロジェクト: Victoriq30/Book-Journal
        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;
            }
        }
コード例 #3
0
        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();
        }