Example #1
0
        public bool UcusEkle(cUcus u)
        {
            bool          sonuc = false;
            SqlConnection conn  = new SqlConnection(gnl.connStr);
            SqlCommand    comm  = new SqlCommand("sp_UcusEkle", conn);

            comm.CommandType = CommandType.StoredProcedure;

            comm.Parameters.Add("@NeredenID", SqlDbType.Int).Value    = u._neredenID;
            comm.Parameters.Add("@NereyeID", SqlDbType.Int).Value     = u._nereyeID;
            comm.Parameters.Add("@Mesafe", SqlDbType.Int).Value       = u._mesafe;
            comm.Parameters.Add("@TKalkis", SqlDbType.DateTime).Value = u._tahminiKalkis;
            comm.Parameters.Add("@TVaris", SqlDbType.DateTime).Value  = u._tahminiVaris;
            comm.Parameters.Add("@PID", SqlDbType.Int).Value          = u._pilotID;
            comm.Parameters.Add("@KEID", SqlDbType.Int).Value         = u._kabinEkibiID;
            comm.Parameters.Add("@Ucret", SqlDbType.Money).Value      = u._ucret;
            comm.Parameters.Add("@UID", SqlDbType.Int).Value          = u._ucakID;

            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            try
            {
                sonuc = Convert.ToBoolean(comm.ExecuteNonQuery());
            }
            catch (SqlException ex)
            {
                string hata = ex.Message;
            }
            finally { conn.Close(); }

            return(sonuc);
        }
Example #2
0
 private void btnDegistir_Click(object sender, EventArgs e)
 {
     cUcus u = new cUcus();
     u.UcusID = Convert.ToInt32(txtUcusID.Text);
     u.NeredenID = Convert.ToInt32(txtNeredenID.Text);
     u.NereyeID = Convert.ToInt32(txtNereyeID.Text);
     u.Mesafe = Convert.ToInt32(txtMesafe.Text);
     u.TahminiKalkis = Convert.ToDateTime(txtKTar.Text + " " + mtxtKSa.Text);
     u.TahminiVaris = Convert.ToDateTime(txtVTar.Text + " " + mtxtVSa.Text);
     u.PilotID = Convert.ToInt32(txtPilotID.Text);
     u.KabinEkibiID = Convert.ToInt32(txtKabinEkibiID.Text);
     u.Ucret = Convert.ToDecimal(txtUcret.Text);
     u.UcakID = Convert.ToInt32(txtUcakID.Text);
     bool sonuc = u.UcusGuncelle(u);
     if (txtNeredenID.Text.Trim() != "" || txtNereyeID.Text.Trim() != "")
     {
         if (sonuc)
         {
             MessageBox.Show("Uçuş Bilgileri Değiştirildi.");
             Temizle();
             btnDegistir.Enabled = false;
             btnSil.Enabled = false;
             u.UcuslariGetirGenis(lvUcus);
         }
         else
         {
             MessageBox.Show("Uçuş Bilgileri Değiştirilemedi!");
         }
     }
     else
     {
         MessageBox.Show("Tüm Boşlukları Doldurunuz.");
     }
 }
Example #3
0
        private void btnUcusSorgula_Click(object sender, EventArgs e)
        {
            cUcus     u  = new cUcus();
            DataTable dt = u.UcuslarıGetirByNeredenNereye(cbKita3.SelectedItem.ToString(), cbUlke3.SelectedItem.ToString(), cbNereden2.SelectedItem.ToString(), cbKita4.SelectedItem.ToString(), cbUlke4.SelectedItem.ToString(), cbNereye2.SelectedItem.ToString());

            if (dt.Rows.Count < 1)
            {
                MessageBox.Show("Aradığınız Sonuçta Bir Uçuş Yok.");
            }
            else
            {
                dgvUcus.DataSource = dt;
                GridViewDuzenle();
            }
        }
Example #4
0
        private void frmUcus_Load(object sender, EventArgs e)
        {
            this.Top  = 0;
            this.Left = 0;
            tabUcusSorgulama.SelectedIndex = tabindex;
            slblKullanici.Text             = frmAnaSayfa.logmain.Adsoyad;
            cUcus     u  = new cUcus();
            cPersonel p  = new cPersonel();
            cUcak     uc = new cUcak();

            u.UcuslariGetirGenis(lvUcus);
            p.PilotGetir(cbPilot);
            p.KabinEkibiGetir(cbKabinEkibi);
            uc.UcakGetir(cbUcak);
            DataTable dt = u.UcuslarıGetirByNeredenNereye2DGV(dgvUcus);

            dgvUcus.DataSource = dt;
            GridViewDuzenle();
        }
Example #5
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            cPersonel p  = new cPersonel();
            cUcak     uc = new cUcak();
            cUcus     u  = new cUcus();

            u.NeredenID     = Convert.ToInt32(txtNeredenID.Text);
            u.NereyeID      = Convert.ToInt32(txtNereyeID.Text);
            u.Mesafe        = Convert.ToInt32(txtMesafe.Text);
            u.TahminiKalkis = Convert.ToDateTime(txtKTar.Text + " " + mtxtKSa.Text);
            u.TahminiVaris  = Convert.ToDateTime(txtVTar.Text + " " + mtxtVSa.Text);
            u.PilotID       = Convert.ToInt32(txtPilotID.Text);
            u.KabinEkibiID  = Convert.ToInt32(txtKabinEkibiID.Text);
            u.Ucret         = Convert.ToDecimal(txtUcret.Text);
            u.UcakID        = Convert.ToInt32(txtUcakID.Text);
            bool sonuc = u.UcusEkle(u);

            if (txtNeredenID.Text.Trim() != "" || txtNereyeID.Text.Trim() != "")
            {
                if (sonuc)
                {
                    MessageBox.Show("Uçuş Bilgileri Kaydedildi.");
                    Temizle();
                    btnDegistir.Enabled = false;
                    btnSil.Enabled      = false;
                    u.UcuslariGetirGenis(lvUcus);
                }
                else
                {
                    MessageBox.Show("Uçuş Bilgileri Kaydedilemedi!");
                }
            }
            else
            {
                MessageBox.Show("Tüm Boşlukları Doldurunuz.");
            }
            ButonKontrol1();
            p.PilotGetir(cbPilot);
            p.KabinEkibiGetir(cbKabinEkibi);
            uc.UcakGetir(cbUcak);
        }
Example #6
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            cUcus uc = new cUcus();

            if (MessageBox.Show("Silmek İstiyor musunuz?", "SİLİNSİN Mİ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                bool Sonuc = uc.UcusSil(Convert.ToInt32(txtUcusID.Text));
                if (Sonuc)
                {
                    MessageBox.Show("Uçuş Bilgileri Silindi.");
                    Temizle();
                    btnDegistir.Enabled = false;
                    btnSil.Enabled      = false;
                    uc.UcuslariGetirGenis(lvUcus);
                }
                else
                {
                    MessageBox.Show("Bilgiler Silinemedi!");
                }
            }
        }
Example #7
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            cPersonel p = new cPersonel();
            cUcak uc = new cUcak();
            cUcus u = new cUcus();
            u.NeredenID = Convert.ToInt32(txtNeredenID.Text);
            u.NereyeID = Convert.ToInt32(txtNereyeID.Text);
            u.Mesafe = Convert.ToInt32(txtMesafe.Text);
            u.TahminiKalkis = Convert.ToDateTime(txtKTar.Text + " " + mtxtKSa.Text);
            u.TahminiVaris = Convert.ToDateTime(txtVTar.Text + " " + mtxtVSa.Text);
            u.PilotID = Convert.ToInt32(txtPilotID.Text);
            u.KabinEkibiID = Convert.ToInt32(txtKabinEkibiID.Text);
            u.Ucret = Convert.ToDecimal(txtUcret.Text);
            u.UcakID = Convert.ToInt32(txtUcakID.Text);
            bool sonuc = u.UcusEkle(u);
            if (txtNeredenID.Text.Trim() != "" || txtNereyeID.Text.Trim() != "")
            {
                if (sonuc)
                {
                    MessageBox.Show("Uçuş Bilgileri Kaydedildi.");
                    Temizle();
                    btnDegistir.Enabled = false;
                    btnSil.Enabled = false;
                    u.UcuslariGetirGenis(lvUcus);

                }
                else
                {
                    MessageBox.Show("Uçuş Bilgileri Kaydedilemedi!");
                }
            }
            else
            {
                MessageBox.Show("Tüm Boşlukları Doldurunuz.");
            }
            ButonKontrol1();
            p.PilotGetir(cbPilot);
            p.KabinEkibiGetir(cbKabinEkibi);
            uc.UcakGetir(cbUcak);
        }
Example #8
0
        private void btnDegistir_Click(object sender, EventArgs e)
        {
            cUcus u = new cUcus();

            u.UcusID        = Convert.ToInt32(txtUcusID.Text);
            u.NeredenID     = Convert.ToInt32(txtNeredenID.Text);
            u.NereyeID      = Convert.ToInt32(txtNereyeID.Text);
            u.Mesafe        = Convert.ToInt32(txtMesafe.Text);
            u.TahminiKalkis = Convert.ToDateTime(txtKTar.Text + " " + mtxtKSa.Text);
            u.TahminiVaris  = Convert.ToDateTime(txtVTar.Text + " " + mtxtVSa.Text);
            u.PilotID       = Convert.ToInt32(txtPilotID.Text);
            u.KabinEkibiID  = Convert.ToInt32(txtKabinEkibiID.Text);
            u.Ucret         = Convert.ToDecimal(txtUcret.Text);
            u.UcakID        = Convert.ToInt32(txtUcakID.Text);
            bool sonuc = u.UcusGuncelle(u);

            if (txtNeredenID.Text.Trim() != "" || txtNereyeID.Text.Trim() != "")
            {
                if (sonuc)
                {
                    MessageBox.Show("Uçuş Bilgileri Değiştirildi.");
                    Temizle();
                    btnDegistir.Enabled = false;
                    btnSil.Enabled      = false;
                    u.UcuslariGetirGenis(lvUcus);
                }
                else
                {
                    MessageBox.Show("Uçuş Bilgileri Değiştirilemedi!");
                }
            }
            else
            {
                MessageBox.Show("Tüm Boşlukları Doldurunuz.");
            }
        }
Example #9
0
        public bool UcusGuncelle(cUcus u)
        {
            bool sonuc = false;
            SqlConnection conn = new SqlConnection(gnl.connStr);
            SqlCommand comm = new SqlCommand("sp_UcusGuncelle", conn);
            comm.CommandType = CommandType.StoredProcedure;
            comm.Parameters.Add("@ID", SqlDbType.Int).Value = u._ucusID;
            comm.Parameters.Add("@NeredenID", SqlDbType.Int).Value = u._neredenID;
            comm.Parameters.Add("@NereyeID", SqlDbType.Int).Value = u._nereyeID;
            comm.Parameters.Add("@Mesafe", SqlDbType.Int).Value = u._mesafe;
            comm.Parameters.Add("@TKalkis", SqlDbType.DateTime).Value = u._tahminiKalkis;
            comm.Parameters.Add("@TVaris", SqlDbType.DateTime).Value = u._tahminiVaris;
            comm.Parameters.Add("@PID", SqlDbType.Int).Value = u._pilotID;
            comm.Parameters.Add("@KEID", SqlDbType.Int).Value = u._kabinEkibiID;
            comm.Parameters.Add("@Ucret", SqlDbType.Money).Value = u._ucret;
            comm.Parameters.Add("@UID", SqlDbType.Int).Value = u._ucakID;

            if (conn.State == ConnectionState.Closed) conn.Open();
            try
            {
                sonuc = Convert.ToBoolean(comm.ExecuteNonQuery());
            }
            catch (SqlException ex)
            {
                string hata = ex.Message;
            }
            finally { conn.Close(); }
            return sonuc;
        }
Example #10
0
 private void frmUcus_Load(object sender, EventArgs e)
 {
     this.Top = 0;
     this.Left = 0;
     tabUcusSorgulama.SelectedIndex = tabindex;
     slblKullanici.Text = frmAnaSayfa.logmain.Adsoyad;
     cUcus u = new cUcus();
     cPersonel p = new cPersonel();
     cUcak uc = new cUcak();
     u.UcuslariGetirGenis(lvUcus);
     p.PilotGetir(cbPilot);
     p.KabinEkibiGetir(cbKabinEkibi);
     uc.UcakGetir(cbUcak);
     DataTable dt = u.UcuslarıGetirByNeredenNereye2DGV(dgvUcus);
     dgvUcus.DataSource = dt;
     GridViewDuzenle();
 }
Example #11
0
        private void btnUcusSorgula_Click(object sender, EventArgs e)
        {
            cUcus u = new cUcus();
            DataTable dt = u.UcuslarıGetirByNeredenNereye(cbKita3.SelectedItem.ToString(), cbUlke3.SelectedItem.ToString(), cbNereden2.SelectedItem.ToString(), cbKita4.SelectedItem.ToString(), cbUlke4.SelectedItem.ToString(), cbNereye2.SelectedItem.ToString());

            if (dt.Rows.Count < 1)
            {
                MessageBox.Show("Aradığınız Sonuçta Bir Uçuş Yok.");
            }
            else
            {
                dgvUcus.DataSource = dt;
                GridViewDuzenle();
            }
        }
Example #12
0
 private void btnSil_Click(object sender, EventArgs e)
 {
     cUcus uc = new cUcus();
     if (MessageBox.Show("Silmek İstiyor musunuz?", "SİLİNSİN Mİ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
     {
         bool Sonuc = uc.UcusSil(Convert.ToInt32(txtUcusID.Text));
         if (Sonuc)
         {
             MessageBox.Show("Uçuş Bilgileri Silindi.");
             Temizle();
             btnDegistir.Enabled = false;
             btnSil.Enabled = false;
             uc.UcuslariGetirGenis(lvUcus);
         }
         else
         {
             MessageBox.Show("Bilgiler Silinemedi!");
         }
     }
 }