Ejemplo n.º 1
0
        private void dgvbus_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int index = e.RowIndex;

            if (index < 0)
            {
                return;
            }
            BO.Bus bus = (BO.Bus)dgvbus.Rows[index].DataBoundItem;

            if (bus != null)
            {
                txtid.Text          = bus.BusID.ToString();
                txtcompanyname.Text = bus.EmriKompanise;
            }
            lblcapacity.Visible = false;
            nudcapacity.Visible = false;
            btndelete.Visible   = true;
            dgvbus.DataSource   = busbll.GetALl();
        }
 /// <summary>
 /// Defines actions to be performed when the user select box frome the list
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void busListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     tempBus = (BO.Bus)busListBox.SelectedItem;
     busLabel.DataContext = tempBus;
 }
 private void pbUpdate_Click(object sender, RoutedEventArgs e)
 {
     BO.Bus updateBus = new BO.Bus();
     ((sender as Button).DataContext as BO.Bus).CopyPropertiesTo(updateBus);
     new UpdateBusWindow(updateBus, buses, bl).ShowDialog();
 }