Exemplo n.º 1
0
        public static List <EntityAraclar> AracListele()
        {
            List <EntityAraclar> degerler = new List <EntityAraclar>();
            SqlCommand           komut    = new SqlCommand("AracListesi", SqlBaglantisi.Baglanti);

            komut.CommandType = CommandType.StoredProcedure;

            if (komut.Connection.State != ConnectionState.Open)
            {
                komut.Connection.Open();
            }
            SqlDataReader dr = komut.ExecuteReader();

            while (dr.Read())
            {
                EntityAraclar ent = new EntityAraclar();
                ent.Id    = Convert.ToInt32(dr["id"]);
                ent.Plaka = dr["Plaka"].ToString();
                ent.Marka = dr["Marka"].ToString();
                ent.Model = dr["Model"].ToString();
                ent.Km    = Convert.ToInt32(dr["Km"]);
                ent.Renk  = dr["Renk"].ToString();
                ent.Vites = dr["Vites"].ToString();
                degerler.Add(ent);
            }
            dr.Close();
            return(degerler);
        }
Exemplo n.º 2
0
 public static bool Guncelle(EntityAraclar deger)
 {
     if (deger.Plaka != null && deger.Marka != null && deger.Model != null && deger.Km > 0)
     {
         return(FacadeAraclar.Guncelle(deger));
     }
     return(false);
 }
Exemplo n.º 3
0
 public static int Ekle(EntityAraclar deger)
 {
     if (deger.Plaka != null && deger.Marka != null && deger.Model != null && deger.Km > 0)
     {
         return(FacadeAraclar.Ekle(deger));
     }
     return(-1);
 }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            EntityAraclar ent = new EntityAraclar();

            ent.Plaka = TxtPlaka.Text;
            ent.Marka = TxtMarka.Text;
            ent.Model = TxtModel.Text;
            ent.Renk  = TxtRenk.Text;
            ent.Km    = Convert.ToInt32(TxtKm.Text);
            ent.Vites = CmbVites.Text;
            ent.Id    = Convert.ToInt32(CmbPlaka.SelectedValue);
            BLLAraclar.Guncelle(ent);
            MessageBox.Show("Arac Guncelleme Islemi Basari Ile Sonuclandi");
            AracListesi();
        }
Exemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            EntityAraclar ent = new EntityAraclar();

            ent.Plaka = TxtPlaka.Text;
            ent.Marka = TxtMarka.Text;
            ent.Model = TxtModel.Text;
            ent.Renk  = TxtRenk.Text;
            ent.Km    = Convert.ToInt32(TxtKm.Text);
            ent.Vites = CmbVites.Text;
            BLLAraclar.Ekle(ent);
            MessageBox.Show("Arac Ekleme Islemi Basari Ile Sonuclandi");
            this.Close();
            Araclar goster = new Araclar();

            goster.Show();
        }
Exemplo n.º 6
0
        public static int Ekle(EntityAraclar deger)
        {
            SqlCommand komut = new SqlCommand("AracEkle", SqlBaglantisi.Baglanti);

            komut.CommandType = CommandType.StoredProcedure;

            if (komut.Connection.State != ConnectionState.Open)
            {
                komut.Connection.Open();
            }
            komut.Parameters.AddWithValue("Plaka", deger.Plaka);
            komut.Parameters.AddWithValue("Marka", deger.Marka);
            komut.Parameters.AddWithValue("Model", deger.Model);
            komut.Parameters.AddWithValue("Renk", deger.Renk);
            komut.Parameters.AddWithValue("Km", deger.Km);
            komut.Parameters.AddWithValue("Vites", deger.Vites);
            return(komut.ExecuteNonQuery());
        }