public UpdateChange() { InitializeComponent(); data = new AccessData(); result = new DataResult(); dao = new FlightDao(); t = new DataTable(); worker = new BackgroundWorker(); }
public EditSchedule(FlightViewModel model) { InitializeComponent(); this.model = model; flightDao = new FlightDao(); model = flightDao.GetFlightViewModel(model.ID); lbFrom.Text = model.From; lbTo.Text = model.To; lbAircraft.Text = model.Aircraft; dtpDate.Value = model.DateFlight; dtpTime.Value = model.DateFlight.Add(model.TimeFlight); txtEconomyPrice.Text = model.EconomyPrice.ToString(); }
public Form1() { InitializeComponent(); flightDao = new FlightDao(); list = new List <FlightViewModel>(); list = flightDao.GetAllViewModel(); btnCofirm = CofirmButton(); btnCofirm.Click += BtnCofirm_Click; dao = new AirportDao(); ComboboxItem combobox = new ComboboxItem(); combobox.Text = "=====Airport====="; combobox.Value = 0; cbxFrom.Items.Add(combobox); cbxTo.Items.Add(combobox); foreach (var item in dao.GetListAirport()) { ComboboxItem cb = new ComboboxItem(); cb.Text = item.Name; cb.Value = item.ID; cbxFrom.Items.Add(cb); cbxTo.Items.Add(cb); } cbxFrom.SelectedIndex = 0; cbxTo.SelectedIndex = 0; cbxSort.Items.AddRange(new object[] { new ComboboxItem() { Text = "Date", Value = 0 }, new ComboboxItem() { Text = "Time", Value = 1 }, new ComboboxItem() { Text = "Economy Price", Value = 2 } }); cbxSort.SelectedIndex = 0; list = list.OrderByDescending(x => x.DateFlight).ToList(); }