Beispiel #1
0
        private void button_return_Click(object sender, EventArgs e)
        {
            operate op = new operate();

            foreach (DataGridViewRow select_row in dataGridView_book_list.SelectedRows)
            {
                string id      = select_row.Cells["id"].Value.ToString();
                string book_id = select_row.Cells["book_id"].Value.ToString();
                op.return_book(id, book_id);
            }
            MessageBox.Show("归还完毕");
        }
Beispiel #2
0
        private void button_renew_list_Click(object sender, EventArgs e)
        {
            operate op = new operate();

            while (dataGridView_book_list.Rows.Count != 0)
            {
                dataGridView_book_list.Rows.RemoveAt(0);
            }
            foreach (string book_id in op.get_borrow_list(1, this.user_id))
            {
                dataGridView_book_list.Rows.Add(op.get_borrow_id(book_id), book_id, op.get_book_name(book_id));
            }
        }
Beispiel #3
0
        private void button_save_Click(object sender, EventArgs e)
        {
            operate op = new operate();

            foreach (DataGridViewRow select_row in dataGridView_book_list.Rows)
            {
                op.renew_book_name(select_row.Cells["book_id"].Value.ToString(), select_row.Cells["book_name"].Value.ToString());
                op.renew_book_author(select_row.Cells["book_id"].Value.ToString(), select_row.Cells["book_author"].Value.ToString());
                op.renew_book_count(select_row.Cells["book_id"].Value.ToString(), Convert.ToInt32(select_row.Cells["book_count"].Value));
            }
            MessageBox.Show("修改完毕");
            this.Close();
        }
Beispiel #4
0
        private void button_remove_book_Click(object sender, EventArgs e)
        {
            int     remove_count = 0;
            operate op           = new operate();

            foreach (DataGridViewRow select_row in dataGridView_book_list.SelectedRows)
            {
                if (op.remove_book(select_row.Cells["book_id"].Value.ToString()))
                {
                    remove_count++;
                }
            }
            MessageBox.Show("成功删除图书:" + remove_count.ToString() + "本!");
        }
Beispiel #5
0
        private void button_borrow_select_book_Click(object sender, EventArgs e)
        {
            operate op   = new operate();
            string  news = "";

            foreach (DataGridViewRow select_row in dataGridView_book_list.SelectedRows)
            {
                string book_id = select_row.Cells["book_id"].Value.ToString();
                if (op.borrow_book(book_id, 1, login_user_id))
                {
                    news += book_id + "\n";
                }
            }
            MessageBox.Show("成功借阅:\n" + news);
        }
Beispiel #6
0
        private void button_renew_book_list_Click(object sender, EventArgs e)
        {
            operate   op       = new operate();
            ArrayList arr_book = new ArrayList();

            arr_book = op.get_book();
            while (dataGridView_book_list.Rows.Count != 0)
            {
                dataGridView_book_list.Rows.RemoveAt(0);
            }

            for (int i = 0; i < arr_book.Count; i++)
            {
                Book_node node = (Book_node)arr_book[i];
                dataGridView_book_list.Rows.Add(
                    i.ToString(),
                    node.book_id,
                    node.book_name,
                    node.book_author,
                    node.book_count.ToString()
                    );
            }
        }