public AddFlightForm(int id) { InitializeComponent(); this.dt_pickerDeparture.Format = DateTimePickerFormat.Custom; this.dt_pickerDeparture.CustomFormat = "Da't'e: dd. MM. yyyy. Ti'm'e: HH:mm:ss"; this.dtpicker_Landing.Format = DateTimePickerFormat.Custom; this.dtpicker_Landing.CustomFormat = "Da't'e: dd. MM. yyyy. Ti'm'e: HH:mm:ss"; if (id != 0) { this.id = id; FlyDao flyDao = new FlyDaoImplements(); Fly.Fly flight = flyDao.getFlight(id); this.lb_title.Text = "Modify flight"; this.tb_destination.Text = flight.Destination; this.tb_startPoint.Text = flight.Start_point; this.dt_pickerDeparture.Value = flight.Departure_time; this.dtpicker_Landing.Value = flight.Landing_time; } }