Ejemplo n.º 1
0
        private void add_tsbt_Click(object sender, EventArgs e)
        {
            switch (tab_main.SelectedTab.Name)
            {
            case "tab_books":
                add_book_fm add_book_fm = new add_book_fm(conn);
                add_book_fm.Show();
                add_book_fm.FormClosed += books_changed;
                break;

            case "tab_users":
                add_users_fm add_users_fm = new add_users_fm(conn, UserData.READER);
                add_users_fm.Show();
                add_users_fm.FormClosed += users_changed;
                break;

            case "tab_personal":
                add_users_fm add_users_fm2 = new add_users_fm(conn, UserData.PERSONAL);
                add_users_fm2.Show();
                add_users_fm2.FormClosed += users_changed;
                break;

            case "tab_issues":
                tab_main.SelectedIndex = 0;
                break;

            default:
                MessageBox.Show("Ошибка: кнопка добавления сработала неверно!");
                break;
            }
        }
Ejemplo n.º 2
0
        private void edit_tsbt_Click(object sender, EventArgs e)
        {
            switch (tab_main.SelectedTab.Name)
            {
            case "tab_books":
                add_book_fm add_book_fm = new add_book_fm(conn);
                add_book_fm.Text = "Редактировать книгу";
                add_book_fm.show_book(get_book_id());
                add_book_fm.Show();
                add_book_fm.FormClosed += books_changed;
                break;

            case "tab_users":
                add_users_fm add_users_fm = new add_users_fm(conn, UserData.READER);
                add_users_fm.Text = "Редактировать данные";
                add_users_fm.show_user(get_user_id(UserData.READER));
                add_users_fm.Show();
                add_users_fm.FormClosed += users_changed;
                break;

            case "tab_personal":
                add_users_fm add_users_fm2 = new add_users_fm(conn, UserData.PERSONAL);
                add_users_fm2.Text = "Редактировать данные";
                add_users_fm2.show_user(get_user_id(UserData.EDITOR));
                add_users_fm2.Show();
                add_users_fm2.FormClosed += users_changed;
                break;

            case "tab_issues":
                //Form7 fm7 = new Form7(conn, grid_issues.CurrentRow.Cells["f_name"].Value.ToString(), grid_issues.CurrentRow.Cells["reader"].Value.ToString());
                ChangeUserDataForm fm7 = new ChangeUserDataForm(conn, grid_issues.CurrentRow.Cells["id"].Value.ToString());
                fm7.FormClosed += onForm7Closed;
                fm7.Show();

                break;

            default:
                MessageBox.Show("Ошибка: кнопка редактирования сработала неверно!");
                break;
            }
        }
Ejemplo n.º 3
0
 private void add_tsbt_Click(object sender, EventArgs e)
 {
     switch (tab_main.SelectedTab.Name)
     {
         case "tab_books":
             add_book_fm add_book_fm = new add_book_fm(conn);
             add_book_fm.Show();
             add_book_fm.FormClosed += books_changed;
             break;
         case "tab_users":
             add_users_fm add_users_fm = new add_users_fm(conn, UserData.READER);
             add_users_fm.Show();
             add_users_fm.FormClosed += users_changed;
             break;
         case "tab_personal":
             add_users_fm add_users_fm2 = new add_users_fm(conn, UserData.PERSONAL);
             add_users_fm2.Show();
             add_users_fm2.FormClosed += users_changed;
             break;
         case "tab_issues":
             tab_main.SelectedIndex = 0;
             break;
         default:
             MessageBox.Show("Ошибка: кнопка добавления сработала неверно!");
             break;
     }
 }
Ejemplo n.º 4
0
        private void edit_tsbt_Click(object sender, EventArgs e)
        {
            switch (tab_main.SelectedTab.Name)
            {
                case "tab_books":
                    add_book_fm add_book_fm = new add_book_fm(conn);
                    add_book_fm.Text = "Редактировать книгу";
                    add_book_fm.show_book(get_book_id());
                    add_book_fm.Show();
                    add_book_fm.FormClosed += books_changed;
                    break;
                case "tab_users":
                    add_users_fm add_users_fm = new add_users_fm(conn, UserData.READER);
                    add_users_fm.Text = "Редактировать данные";
                    add_users_fm.show_user(get_user_id(UserData.READER));
                    add_users_fm.Show();
                    add_users_fm.FormClosed += users_changed;
                    break;
                case "tab_personal":
                    add_users_fm add_users_fm2 = new add_users_fm(conn, UserData.PERSONAL);
                    add_users_fm2.Text = "Редактировать данные";
                    add_users_fm2.show_user(get_user_id(UserData.EDITOR));
                    add_users_fm2.Show();
                    add_users_fm2.FormClosed += users_changed;
                    break;
                case "tab_issues":
                    //Form7 fm7 = new Form7(conn, grid_issues.CurrentRow.Cells["f_name"].Value.ToString(), grid_issues.CurrentRow.Cells["reader"].Value.ToString());
                    ChangeUserDataForm fm7 = new ChangeUserDataForm(conn,grid_issues.CurrentRow.Cells["id"].Value.ToString());
                    fm7.FormClosed += onForm7Closed;
                    fm7.Show();

                    break;
                default:
                    MessageBox.Show("Ошибка: кнопка редактирования сработала неверно!");
                    break;
            }
        }