コード例 #1
0
 private void delete_button_Click(object sender, EventArgs e)
 {
     if (bus_schedules_listview.SelectedItems.Count > 0)
     {
         Bus bus = (Bus)bus_schedules_listview.SelectedItems[0].Tag;
         _deletedBuses.Add(bus);
         _busService.DeleteBus(bus);
         RefreshBusListView();
     }
 }
コード例 #2
0
        private void add_button_Click(object sender, EventArgs e)
        {
            if (!FieldsFilledCorrectly())
            {
                return;
            }
            if (!ValuesChanged())
            {
                Close();
                return;
            }

            _busService.DeleteBus(_bus);
            _busService.AddNewBus(new Bus
            {
                BusNumber          = bus_number_textbox.Text,
                DepartingStation   = departing_station_textbox.Text,
                DestinationStation = destination_station_textbox.Text,
                DepartingTime      = departing_dateTimePicker.Value,
                ArrivalTime        = arrival_dateTimePicker.Value
            });
            _mainForm.RefreshBusListView();
            Close();
        }
コード例 #3
0
 public bool Delete(int id)
 {
     return(busService.DeleteBus(id));
 }