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