Ejemplo n.º 1
0
 public int Delete(int id,DbTransaction dbTransaction,Database db)
 {
     sqlText="DELETE KATILIMCI where ID=@id ";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@id", DbType.Int32, id);
     Katilimci nesne = new Katilimci();
     nesne.Id = id;
     return base.Delete(nesne, dbComm, dbTransaction, db);
 }
Ejemplo n.º 2
0
 public int DeleteByUnvanId(Int32 unvanId,DbTransaction dbTransaction,Database db)
 {
     sqlText="DELETE KATILIMCI where UNVAN_ID=@unvanId ";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@unvanId", DbType.Int32, unvanId);
     Katilimci nesne=new Katilimci();
     nesne.Id=-1;
     nesne.UnvanId=unvanId;
     return base.Delete(nesne, dbComm, dbTransaction, db);
 }
Ejemplo n.º 3
0
 public Katilimci FillKatilimci(IDataReader reader)
 {
     nesne = new Katilimci();
     nesne.Id=(Int32)reader["ID"];
     nesne.Ad=(String)reader["AD"];
     nesne.Soyad=(String)reader["SOYAD"];
     nesne.Telefon=(String)reader["TELEFON"];
     nesne.Email=(String)reader["EMAIL"];
     nesne.UnvanId=(Int32)reader["UNVAN_ID"];
     return nesne;
 }
Ejemplo n.º 4
0
 public int Update(Katilimci nesne,DbTransaction dbTransaction,Database db)
 {
     sqlText=" UPDATE KATILIMCI set AD = @ad , SOYAD = @soyad , TELEFON = @telefon , EMAIL = @email , UNVAN_ID = @unvanId 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, "@soyad", DbType.String, nesne.Soyad==null?(object)DBNull.Value:nesne.Soyad);
     db.AddInParameter(dbComm, "@telefon", DbType.String, nesne.Telefon==null?(object)DBNull.Value:nesne.Telefon);
     db.AddInParameter(dbComm, "@email", DbType.String, nesne.Email==null?(object)DBNull.Value:nesne.Email);
     db.AddInParameter(dbComm, "@unvanId", DbType.Int32, nesne.UnvanId==null?(object)DBNull.Value:nesne.UnvanId);
     return base.Update(nesne, dbComm, dbTransaction, db);
 }
Ejemplo n.º 5
0
 public int Insert(Katilimci nesne,DbTransaction dbTransaction,Database db)
 {
     sqlText="INSERT INTO KATILIMCI (AD,SOYAD,TELEFON,EMAIL,UNVAN_ID)VALUES(@ad,@soyad,@telefon,@email,@unvanId)SELECT @@IDENTITY";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@ad", DbType.String, nesne.Ad==null?(object)DBNull.Value:nesne.Ad);
     db.AddInParameter(dbComm, "@soyad", DbType.String, nesne.Soyad==null?(object)DBNull.Value:nesne.Soyad);
     db.AddInParameter(dbComm, "@telefon", DbType.String, nesne.Telefon==null?(object)DBNull.Value:nesne.Telefon);
     db.AddInParameter(dbComm, "@email", DbType.String, nesne.Email==null?(object)DBNull.Value:nesne.Email);
     db.AddInParameter(dbComm, "@unvanId", DbType.Int32, nesne.UnvanId==null?(object)DBNull.Value:nesne.UnvanId);
     return base.Insert(nesne, dbComm, dbTransaction, db);
 }
Ejemplo n.º 6
0
 public Katilimci GetById(int id,Database db)
 {
     nesne = new Katilimci();
     sqlText="Select ID,AD,SOYAD,TELEFON,EMAIL,UNVAN_ID from KATILIMCI where ID=@id ";
      			dbComm = db.GetSqlStringCommand(sqlText);
     db.AddInParameter(dbComm, "@id", DbType.Int32, id);
     using (IDataReader reader = db.ExecuteReader(dbComm)){
         if(reader.Read()){
             nesne = FillKatilimci(reader);
         }else nesne=null;
     }
     return nesne;
 }