示例#1
0
 public Kulup FillKulup(IDataReader reader)
 {
     nesne = new Kulup();
     nesne.Id=(Int32)reader["ID"];
     if(!(reader["AD"] is System.DBNull))nesne.Ad=(String)reader["AD"];
     if(!(reader["SIFRE"] is System.DBNull))nesne.Sifre=(String)reader["SIFRE"];
     return nesne;
 }
示例#2
0
 public int Delete(int id,DbTransaction dbTransaction,Database db)
 {
     sqlText="DELETE KULUP where ID=@id ";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@id", DbType.Int32, id);
     Kulup nesne = new Kulup();
     nesne.Id = id;
     return base.Delete(nesne, dbComm, dbTransaction, db);
 }
示例#3
0
 public Kulup GetById(int id,Database db)
 {
     nesne = new Kulup();
     sqlText="Select ID,AD,SIFRE from KULUP where ID=@id ";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@id", DbType.Int32, id);
     using (IDataReader reader = db.ExecuteReader(dbComm)){
         if(reader.Read()){
             nesne = FillKulup(reader);
         }else nesne=null;
     }
     return nesne;
 }
示例#4
0
 public int Update(Kulup nesne,DbTransaction dbTransaction,Database db)
 {
     sqlText=" UPDATE KULUP set AD = @ad , SIFRE = @sifre WHERE ID = @id ";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@id", DbType.Int32, nesne.Id==null?(object)DBNull.Value:nesne.Id);
     db.AddInParameter(dbComm, "@ad", DbType.String, nesne.Ad==null?(object)DBNull.Value:nesne.Ad);
     db.AddInParameter(dbComm, "@sifre", DbType.String, nesne.Sifre==null?(object)DBNull.Value:nesne.Sifre);
     return base.Update(nesne, dbComm, dbTransaction, db);
 }
示例#5
0
 public int Insert(Kulup nesne,DbTransaction dbTransaction,Database db)
 {
     sqlText="INSERT INTO KULUP (ID,AD,SIFRE)VALUES(@id,@ad,@sifre)SELECT @@IDENTITY";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@id", DbType.Int32, nesne.Id==null?(object)DBNull.Value:nesne.Id);
     db.AddInParameter(dbComm, "@ad", DbType.String, nesne.Ad==null?(object)DBNull.Value:nesne.Ad);
     db.AddInParameter(dbComm, "@sifre", DbType.String, nesne.Sifre==null?(object)DBNull.Value:nesne.Sifre);
     return base.Insert(nesne, dbComm, dbTransaction, db);
 }