Beispiel #1
0
 public Secenek FillSecenek(IDataReader reader)
 {
     nesne = new Secenek();
     nesne.Id=(Int32)reader["ID"];
     nesne.Aciklama=(String)reader["ACIKLAMA"];
     return nesne;
 }
Beispiel #2
0
 public int Delete(int id,DbTransaction dbTransaction,Database db)
 {
     sqlText="DELETE SECENEK where ID=@id ";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@id", DbType.Int32, id);
     Secenek nesne = new Secenek();
     nesne.Id = id;
     return base.Delete(nesne, dbComm, dbTransaction, db);
 }
Beispiel #3
0
 public Secenek GetById(int id,Database db)
 {
     nesne = new Secenek();
     sqlText="Select ID,ACIKLAMA from SECENEK where ID=@id ";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@id", DbType.Int32, id);
     using (IDataReader reader = db.ExecuteReader(dbComm)){
         if(reader.Read()){
             nesne = FillSecenek(reader);
         }else nesne=null;
     }
     return nesne;
 }
Beispiel #4
0
 public int Update(Secenek nesne,DbTransaction dbTransaction,Database db)
 {
     sqlText=" UPDATE SECENEK set ACIKLAMA = @aciklama WHERE ID = @id ";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@id", DbType.Int32, nesne.Id==null?(object)DBNull.Value:nesne.Id);
     db.AddInParameter(dbComm, "@aciklama", DbType.String, nesne.Aciklama==null?(object)DBNull.Value:nesne.Aciklama);
     return base.Update(nesne, dbComm, dbTransaction, db);
 }
Beispiel #5
0
 public int Insert(Secenek nesne,DbTransaction dbTransaction,Database db)
 {
     sqlText="INSERT INTO SECENEK (ACIKLAMA)VALUES(@aciklama)SELECT @@IDENTITY";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@aciklama", DbType.String, nesne.Aciklama==null?(object)DBNull.Value:nesne.Aciklama);
     return base.Insert(nesne, dbComm, dbTransaction, db);
 }