예제 #1
0
        private void addRentBtn_Click(object sender, EventArgs e)
        {
            Rent        rent         = new Rent();
            NewRentForm newOrderForm = new NewRentForm(rent);

            if (newOrderForm.ShowDialog() == DialogResult.OK)
            {
                rents.Add(rent);
                rentsListBox.Items.Add(rent);
                shortInfoListBox.Items.Add(rent.ToShortString());
            }
        }
예제 #2
0
        private void editRentBtn_Click(object sender, EventArgs e)
        {
            if (!IsSelectedOneRent())
            {
                return;
            }
            NewRentForm newOrderForm = new NewRentForm(rents[currentListBoxItemIndex]);

            if (newOrderForm.ShowDialog() == DialogResult.OK)
            {
                rentsListBox.Items[currentListBoxItemIndex]     = rents[currentListBoxItemIndex];
                shortInfoListBox.Items[currentListBoxItemIndex] = rents[currentListBoxItemIndex].ToShortString();
            }
        }