Esempio n. 1
0
 private void btnTicketSearch_Click(object sender, EventArgs e)
 {
     if (TicketSearchByDepartureStationAndArrivalStationAndPrise())
     {
         return;
     }
     if (TicketSearchByDepartureStationAndArrivalStation())
     {
         return;
     }
     if (TicketSearchByDepartureStationAndPrice())
     {
         return;
     }
     if (TicketSearchByArrivalStationAndPrise())
     {
         return;
     }
     if (TicketSearchByArrivalStation())
     {
         return;
     }
     if (TicketSearchByDepartureStation())
     {
         return;
     }
     if (TicketSearchByPrise())
     {
         return;
     }
     dgvTickets.DataSource = TicketDAL.GetAllTickets();
 }
Esempio n. 2
0
 private void TicketsFilling()
 {
     foreach (Ticket tic in TicketDAL.GetAllTickets())
     {
         cbTicPrice.Items.Add(tic.Price);
     }
     cbTicPrice.SelectedIndex = 0;
 }
Esempio n. 3
0
        private void btnTicketAdd_Click(object sender, EventArgs e)
        {
            fmAddTicket f = new fmAddTicket();

            if (f.ShowDialog() == DialogResult.OK)
            {
                MessageBox.Show("Строка добавлена");
                dgvTickets.DataSource = TicketDAL.GetAllTickets();
            }
        }
Esempio n. 4
0
 private void DataGridVeiwFilling()
 {
     dgvRT.AutoGenerateColumns      = false;
     dgvRT.DataSource               = PassengerDAL.GetAllPassengers();
     dgvTable.AutoGenerateColumns   = false;
     dgvTable.DataSource            = TrainTableDAL.GetAllTrainTables();
     dgvCT.AutoGenerateColumns      = false;
     dgvCT.DataSource               = CanceledTripDAL.GetAllCancelledTrips();
     dgvTrips.AutoGenerateColumns   = false;
     dgvTrips.DataSource            = TripDAL.GetAllTrips();
     dgvTickets.AutoGenerateColumns = false;
     dgvTickets.DataSource          = TicketDAL.GetAllTickets();
 }
Esempio n. 5
0
        private void btnChange_Click(object sender, EventArgs e)
        {
            string         type  = dgvTickets.SelectedCells[0].OwningColumn.Name;
            string         value = dgvTickets.SelectedCells[0].Value.ToString();
            int            id    = (dgvTickets.SelectedCells[0].OwningRow.DataBoundItem as Ticket).Id_Ticket;
            fmChangeTicket f     = new fmChangeTicket(type, value, id);

            f.Text = dgvTickets.SelectedCells[0].OwningColumn.HeaderText;
            if (f.ShowDialog() == DialogResult.OK)
            {
                MessageBox.Show("Значение изменено");
                dgvTickets.DataSource = TicketDAL.GetAllTickets();
            }
        }
Esempio n. 6
0
 private void btnTicketDel_Click(object sender, EventArgs e)
 {
     TicketDAL.Delete((dgvTickets.SelectedCells[0].OwningRow.DataBoundItem as Ticket).Id_Ticket);
     dgvTickets.DataSource = TicketDAL.GetAllTickets();
     MessageBox.Show("Строка удалена");
 }