Ejemplo n.º 1
0
        private void miBooks_Click(object sender, EventArgs e)  //открытие справочника Книги
        {
            BookForm bookForm = new BookForm();

            switch (AuthorizationForm.userRole)
            {
            case 1:
                bookForm.btnInsert.Enabled           = true;
                bookForm.btnUpdate.Enabled           = true;
                bookForm.btnDelete.Enabled           = true;
                bookForm.btnUpdateGenre.Enabled      = true;
                bookForm.btnUpdatePublishing.Enabled = true;
                bookForm.btnUpdateWriter.Enabled     = true;
                break;

            case 4:
                bookForm.btnInsert.Enabled           = true;
                bookForm.btnUpdate.Enabled           = true;
                bookForm.btnDelete.Enabled           = true;
                bookForm.btnUpdateGenre.Enabled      = true;
                bookForm.btnUpdatePublishing.Enabled = true;
                bookForm.btnUpdateWriter.Enabled     = true;
                break;
            }
            bookForm.Show(this);
        }
Ejemplo n.º 2
0
        private void bookMenuView_Click(object sender, EventArgs e)
        {
            var f = new BookForm(1);

            foreach (Control c in f.tabControl.Controls)
            {
                c.Enabled = false;
            }

            using (context = new LibContext(LibConnection.GetConnString()))
            {
                DataGridViewRow selectedRow = viewBooks.SelectedRows[0];
                int             value       = (int)selectedRow.Cells[4].Value;
                f.book = context.books.Where(b => b.bID == value).First();

                f.authors = from a in context.authors

                            where a.bID == value

                            where a.bID == (int)selectedRow.Cells[4].Value

                            select a;
                f.fillForm();
            }
            f.FormClosed += new FormClosedEventHandler(BookForm_Closed);
            f.Show();
        }
Ejemplo n.º 3
0
        private void btnUpdateBook_Click(object sender, EventArgs e)    //открытие справочника книги
        {
            BookForm bookForm = new BookForm();

            bookForm.Show(this);
        }
Ejemplo n.º 4
0
        private void btnAddBook_Click(object sender, EventArgs e)
        {
            BookForm form = new BookForm(0);

            form.Show();
        }