Пример #1
0
 public SecenekTip FillSecenekTip(IDataReader reader)
 {
     nesne = new SecenekTip();
     nesne.Id=(Int32)reader["ID"];
     nesne.Aciklama=(String)reader["ACIKLAMA"];
     return nesne;
 }
Пример #2
0
 public int Delete(int id,DbTransaction dbTransaction,Database db)
 {
     sqlText="DELETE SECENEK_TIP where ID=@id ";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@id", DbType.Int32, id);
     SecenekTip nesne = new SecenekTip();
     nesne.Id = id;
     return base.Delete(nesne, dbComm, dbTransaction, db);
 }
Пример #3
0
 public SecenekTip GetById(int id,Database db)
 {
     nesne = new SecenekTip();
     sqlText="Select ID,ACIKLAMA from SECENEK_TIP where ID=@id ";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@id", DbType.Int32, id);
     using (IDataReader reader = db.ExecuteReader(dbComm)){
         if(reader.Read()){
             nesne = FillSecenekTip(reader);
         }else nesne=null;
     }
     return nesne;
 }
Пример #4
0
 public int Update(SecenekTip nesne,DbTransaction dbTransaction,Database db)
 {
     sqlText=" UPDATE SECENEK_TIP 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);
 }
Пример #5
0
 public int Insert(SecenekTip nesne,DbTransaction dbTransaction,Database db)
 {
     sqlText="INSERT INTO SECENEK_TIP (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);
 }