Exemple #1
0
        public void UcakGetir(ComboBox liste)
        {
            SqlConnection conn = new SqlConnection(gnl.connStr);
            SqlCommand    comm = new SqlCommand("select UcakId,UcakAdi from Ucaklar where silindi = 0 and uygunluk=1", conn);

            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            SqlDataReader dr;

            try
            {
                dr = comm.ExecuteReader();
                while (dr.Read())
                {
                    cUcak u = new cUcak();
                    u._ucakID  = Convert.ToInt32(dr[0]);
                    u._ucakAdi = dr[1].ToString();
                    liste.Items.Add(u);
                }
            }
            catch (SqlException ex)
            {
                string hata = ex.Message;
            }
            finally { conn.Close(); }
        }
 private void frmUcakSorgu_Load(object sender, EventArgs e)
 {
     this.Top = 0;
     this.Left = 0;
     cUcak u = new cUcak();
     u.UcakSorguAll(lvArama);
 }
Exemple #3
0
        public bool UcakEkle(cUcak u)
        {
            bool          sonuc = false;
            SqlConnection conn  = new SqlConnection(gnl.connStr);
            SqlCommand    comm  = new SqlCommand("sp_UcakEkle", conn);

            comm.CommandType = CommandType.StoredProcedure;
            comm.Parameters.Add("@UcakAdi", SqlDbType.VarChar).Value     = u._ucakAdi;
            comm.Parameters.Add("@UcakTuru", SqlDbType.VarChar).Value    = u._ucakTuru;
            comm.Parameters.Add("@Kontenjani", SqlDbType.Int).Value      = u._kontenjani;
            comm.Parameters.Add("@UMesafesi", SqlDbType.Int).Value       = u._ucusMesafesi;
            comm.Parameters.Add("@USuresi", SqlDbType.VarChar).Value     = u._ucusSuresi;
            comm.Parameters.Add("@BYMID", SqlDbType.Int).Value           = u._bakiminiYapanMuhendisID;
            comm.Parameters.Add("@SBT", SqlDbType.DateTime).Value        = u._sonBakimTarihi;
            comm.Parameters.Add("@BAciklamasi", SqlDbType.VarChar).Value = u._bakimAciklamasi;

            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);
        }
Exemple #4
0
 private void btnKaydet_Click(object sender, EventArgs e)
 {
     cUcak u = new cUcak();
     u.UcakAdi = txtUcakAdi.Text;
     u.UcakTuru = txtUcakTuru.Text;
     u.Kontenjani = Convert.ToInt32(txtKontenjani.Text);
     u.UcusMesafesi = Convert.ToInt32(txtUcusMes.Text);
     u.UcusSuresi = txtUcusSur.Text;
     u.BakiminiYapanMuhendisID = Convert.ToInt32(txtBYMID.Text);
     u.SonBakimTarihi = Convert.ToDateTime(txtSonBakTar.Text);
     u.BakimAciklamasi = txtBakAciklamasi.Text;
     bool sonuc = u.UcakEkle(u);
     if (txtUcakAdi.Text != "" && txtUcakTuru.Text != "" && txtKontenjani.Text != "" && txtUcusMes.Text != "" && txtBYMID.Text != "")
     {
         if (sonuc)
         {
             MessageBox.Show("Uçak Bilgileri Kaydedildi.");
             Temizle();
             btnDegistir.Enabled = false;
             btnSil.Enabled = false;
             u.UcakBilgileriGetir(lvUcakBilgileri);
         }
         else
         {
             MessageBox.Show("Uçak Bilgileri Kaydedilemedi!");
         }
     }
     else
     {
         MessageBox.Show("Tüm Boşlukları Doldurunuz.");
     }
 }
Exemple #5
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            cUcak u = new cUcak();

            u.UcakAdi                 = txtUcakAdi.Text;
            u.UcakTuru                = txtUcakTuru.Text;
            u.Kontenjani              = Convert.ToInt32(txtKontenjani.Text);
            u.UcusMesafesi            = Convert.ToInt32(txtUcusMes.Text);
            u.UcusSuresi              = txtUcusSur.Text;
            u.BakiminiYapanMuhendisID = Convert.ToInt32(txtBYMID.Text);
            u.SonBakimTarihi          = Convert.ToDateTime(txtSonBakTar.Text);
            u.BakimAciklamasi         = txtBakAciklamasi.Text;
            bool sonuc = u.UcakEkle(u);

            if (txtUcakAdi.Text != "" && txtUcakTuru.Text != "" && txtKontenjani.Text != "" && txtUcusMes.Text != "" && txtBYMID.Text != "")
            {
                if (sonuc)
                {
                    MessageBox.Show("Uçak Bilgileri Kaydedildi.");
                    Temizle();
                    btnDegistir.Enabled = false;
                    btnSil.Enabled      = false;
                    u.UcakBilgileriGetir(lvUcakBilgileri);
                }
                else
                {
                    MessageBox.Show("Uçak Bilgileri Kaydedilemedi!");
                }
            }
            else
            {
                MessageBox.Show("Tüm Boşlukları Doldurunuz.");
            }
        }
Exemple #6
0
        private void cbUcak_SelectedIndexChanged(object sender, EventArgs e)
        {
            cUcak uc = (cUcak)cbUcak.SelectedItem;

            txtUcak.Text   = uc.UcakAdi;
            txtUcakID.Text = uc.UcakID.ToString();
            ButonKontrol1();
        }
        private void frmUcakSorgu_Load(object sender, EventArgs e)
        {
            this.Top  = 0;
            this.Left = 0;
            cUcak u = new cUcak();

            u.UcakSorguAll(lvArama);
        }
Exemple #8
0
        private void frmUcak_Load(object sender, EventArgs e)
        {
            this.Top  = 0;
            this.Left = 0;
            cUcak u = new cUcak();

            u.UcakBilgileriGetir(lvUcakBilgileri);
            cPersonel p = new cPersonel();

            p.BakimMuhGetir(cbMuhendis);
        }
Exemple #9
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();
        }
Exemple #10
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);
        }
Exemple #11
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            cUcak u = new cUcak();

            if (MessageBox.Show("Silmek İstiyor musunuz?", "SİLİNSİN Mİ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                bool Sonuc = u.UcakSil(Convert.ToInt32(txtUcakID.Text));
                if (Sonuc)
                {
                    MessageBox.Show("Uçuş Bilgileri Silindi.");
                    Temizle();
                    btnDegistir.Enabled = false;
                    btnSil.Enabled      = false;
                    u.UcakBilgileriGetir(lvUcakBilgileri);
                }
                else
                {
                    MessageBox.Show("Bilgiler Silinemedi!");
                }
            }
        }
Exemple #12
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);
        }
        private void txtArama_TextChanged(object sender, EventArgs e)
        {
            cUcak u = new cUcak();

            u.UcakSorgu(lvArama, txtArama.Text);
        }
Exemple #14
0
 private void btnSil_Click(object sender, EventArgs e)
 {
     cUcak u = new cUcak();
     if (MessageBox.Show("Silmek İstiyor musunuz?", "SİLİNSİN Mİ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
     {
         bool Sonuc = u.UcakSil(Convert.ToInt32(txtUcakID.Text));
         if (Sonuc)
         {
             MessageBox.Show("Uçuş Bilgileri Silindi.");
             Temizle();
             btnDegistir.Enabled = false;
             btnSil.Enabled = false;
             u.UcakBilgileriGetir(lvUcakBilgileri);
         }
         else
         {
             MessageBox.Show("Bilgiler Silinemedi!");
         }
     }
 }
Exemple #15
0
 private void frmUcak_Load(object sender, EventArgs e)
 {
     this.Top = 0;
     this.Left = 0;
     cUcak u = new cUcak();
     u.UcakBilgileriGetir(lvUcakBilgileri);
     cPersonel p = new cPersonel();
     p.BakimMuhGetir(cbMuhendis);
 }
 private void txtArama_TextChanged(object sender, EventArgs e)
 {
     cUcak u = new cUcak();
     u.UcakSorgu(lvArama, txtArama.Text);
 }
Exemple #17
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();
 }
Exemple #18
0
        public bool UcaklariGuncelle(cUcak u)
        {
            bool sonuc = false;
            SqlConnection conn = new SqlConnection(gnl.connStr);
            SqlCommand comm = new SqlCommand("sp_UcakGuncelle", conn);
            comm.CommandType = CommandType.StoredProcedure;
            comm.Parameters.Add("@ID", SqlDbType.Int).Value = u._ucakID;
            comm.Parameters.Add("@UcakAdi", SqlDbType.VarChar).Value = u._ucakAdi;
            comm.Parameters.Add("@UcakTuru", SqlDbType.VarChar).Value = u._ucakTuru;
            comm.Parameters.Add("@Kontenjani", SqlDbType.Int).Value = u._kontenjani;
            comm.Parameters.Add("@UMesafesi", SqlDbType.Int).Value = u._ucusMesafesi;
            comm.Parameters.Add("@USuresi", SqlDbType.VarChar).Value = u._ucusSuresi;
            comm.Parameters.Add("@BYMID", SqlDbType.Int).Value = u._bakiminiYapanMuhendisID;
            comm.Parameters.Add("@SBT", SqlDbType.DateTime).Value = u._sonBakimTarihi;
            comm.Parameters.Add("@BAciklamasi", SqlDbType.VarChar).Value = u._bakimAciklamasi;

            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;
        }
Exemple #19
0
 public void UcakGetir(ComboBox liste)
 {
     SqlConnection conn = new SqlConnection(gnl.connStr);
     SqlCommand comm = new SqlCommand("select UcakId,UcakAdi from Ucaklar where silindi = 0 and uygunluk=1", conn);
     if (conn.State == ConnectionState.Closed) conn.Open();
     SqlDataReader dr;
     try
     {
         dr = comm.ExecuteReader();
         while (dr.Read())
         {
             cUcak u = new cUcak();
             u._ucakID = Convert.ToInt32(dr[0]);
             u._ucakAdi = dr[1].ToString();
             liste.Items.Add(u);
         }
     }
     catch (SqlException ex)
     {
         string hata = ex.Message;
     }
     finally { conn.Close(); }
 }