Beispiel #1
0
        private void PlusB_Click(object sender, EventArgs e)
        {
            BookDeteilsForm bdf    = new BookDeteilsForm(new BookDetail());
            var             result = bdf.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                BookList.Items.Add(bdf.bd);
                RecalculatePrice();
            }
        }
Beispiel #2
0
        private void BookList_SelectedIndexChanged(object sender, EventArgs e)
        {
            MinusB.Enabled = true;
            var bkl = BookList.SelectedItem as BookDetail;

            if (bkl == null)
            {
                return;
            }
            var form   = new BookDeteilsForm(bkl);
            var result = form.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                var si = BookList.SelectedIndex;
                BookList.Items.RemoveAt(si);
                BookList.Items.Insert(si, form.bd);
            }
        }