public List <AracKmler> TumVeriyiGetir() { List <AracKmler> arackmler = null; AracKmler arackm = null; DataTable dt = null; dt = repo.TumVeriyiGetir(); if (dt != null) { arackmler = new List <AracKmler>(); for (int i = 0; i < dt.Rows.Count; i++) { arackm = new AracKmler() { AracKmId = Convert.ToInt32(dt.Rows[i]["AracKmId"]), AracBaslangicKm = Convert.ToInt32(dt.Rows[i]["AracBaslangicKm"]), AracBitisKm = Convert.ToInt32(dt.Rows[i]["AracBitisKm"]), AracId = Convert.ToInt32(dt.Rows[i]["AracId"]), SilindiMi = Convert.ToBoolean(dt.Rows[i]["AracId"]) }; arackmler.Add(arackm); } } return(arackmler); }
public bool Sil(AracKmler obje) { try { string strSql = "UPDATE AracKmler SET SilindiMi = 1 WHERE AracKmId = '" + obje.AracKmId + "'"; Baglanti.VeriGuncelle(strSql); } catch (Exception ex) { } return(false); }
public bool Guncelle(AracKmler obje) { try { string strSql = @"UPDATE AracKmler SET AracId = '" + obje.AracId + "', AracBaslangicKm = '" + obje.AracBaslangicKm + "', AracBitisKm = '" + obje.AracBitisKm + "'"; Baglanti.VeriGuncelle(strSql); } catch (Exception ex) { } return(false); }
public bool Ekle(AracKmler obje) { try { Baglanti.BaglantiKontrol(); var strSql = @" INSERT INTO [dbo].[AracKmler] ([AracId] ,[AracBaslangicKm] ,[AracBitisKm] VALUES ('" + obje.AracId + "','" + obje.AracBaslangicKm + "', '" + obje.AracBitisKm + "',);"; SqlCommand sqlCommand = new SqlCommand(strSql, Baglanti.sqlConnection); sqlCommand.ExecuteNonQuery(); return(true); } catch (Exception ex) { } return(false); }
public AracKmler IdyeGoreGetir(int Id) { DataTable dt = null; AracKmler arackm = null; dt = repo.IdyeGoreGetir(Id); if (dt != null) { for (int i = 0; i < dt.Rows.Count; i++) { arackm = new AracKmler() { AracKmId = Convert.ToInt32(dt.Rows[i]["AracKmId"]), AracBaslangicKm = Convert.ToInt32(dt.Rows[i]["AracBaslangicKm"]), AracBitisKm = Convert.ToInt32(dt.Rows[i]["AracBitisKm"]), AracId = Convert.ToInt32(dt.Rows[i]["AracId"]), SilindiMi = Convert.ToBoolean(dt.Rows[i]["AracId"]) }; } } return(arackm); }
public bool Sil(AracKmler obje) { return(repo.Sil(obje)); }
public bool Guncelle(AracKmler obje) { return(repo.Guncelle(obje)); }
public bool Ekle(AracKmler obje) { return(repo.Ekle(obje)); }