예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            AdminFlightDal adminFlightDal = new AdminFlightDal();

            if (checkBox1.Checked == false)
            {
                adminFlightDal.add(new adminlflightInformations
                {
                    departureAırport = comboNereden.Text,
                    landingAırport   = comboNereye.Text,
                    departureTıme    = Convert.ToDateTime(dateTimeGidis.Text),
                    returnTıme       = Convert.ToDateTime(dateTimeDonus.Text),
                    Price            = Convert.ToInt32(textBox2.Text),
                    Company          = textBox1.Text
                });
                dataGridView1.DataSource = adminFlight.GetAll();
            }
            else
            {
                adminFlightDal.add(new adminlflightInformations
                {
                    departureAırport = comboNereden.Text,
                    landingAırport   = comboNereye.Text,
                    departureTıme    = Convert.ToDateTime(dateTimeGidis.Text),
                    Price            = Convert.ToInt32(textBox2.Text),
                    Company          = textBox1.Text
                });
            }
            dataGridView1.DataSource = adminFlight.GetAll();
        }