public SoruSecenekAratablo FillSoruSecenekAratablo(IDataReader reader) { nesne = new SoruSecenekAratablo(); nesne.SoruId=(Int32)reader["SORU_ID"]; nesne.SecenekId=(Int32)reader["SECENEK_ID"]; return nesne; }
public int Delete(int secenekId,DbTransaction dbTransaction,Database db) { sqlText="DELETE SORU_SECENEK_ARATABLO where SECENEK_ID=@secenekId "; dbComm = db.GetSqlStringCommand(sqlText); db.AddInParameter(dbComm, "@secenekId", DbType.Int32, secenekId); SoruSecenekAratablo nesne = new SoruSecenekAratablo(); nesne.SecenekId = secenekId; return base.Delete(nesne, dbComm, dbTransaction, db); }
public int Insert(SoruSecenekAratablo nesne,DbTransaction dbTransaction,Database db) { sqlText="INSERT INTO SORU_SECENEK_ARATABLO (SORU_ID,SECENEK_ID)VALUES(@soruId,@secenekId)SELECT @@IDENTITY"; dbComm = db.GetSqlStringCommand(sqlText); db.AddInParameter(dbComm, "@soruId", DbType.Int32, nesne.SoruId==null?(object)DBNull.Value:nesne.SoruId); db.AddInParameter(dbComm, "@secenekId", DbType.Int32, nesne.SecenekId==null?(object)DBNull.Value:nesne.SecenekId); return base.Insert(nesne, dbComm, dbTransaction, db); }
public int Update(SoruSecenekAratablo nesne,DbTransaction dbTransaction,Database db) { sqlText=" UPDATE SORU_SECENEK_ARATABLO set SORU_ID = @soruId WHERE SECENEK_ID = @secenekId "; dbComm = db.GetSqlStringCommand(sqlText); db.AddInParameter(dbComm, "@soruId", DbType.Int32, nesne.SoruId==null?(object)DBNull.Value:nesne.SoruId); db.AddInParameter(dbComm, "@secenekId", DbType.Int32, nesne.SecenekId==null?(object)DBNull.Value:nesne.SecenekId); return base.Update(nesne, dbComm, dbTransaction, db); }
public SoruSecenekAratablo GetById(int secenekId,Database db) { nesne = new SoruSecenekAratablo(); sqlText="Select SORU_ID,SECENEK_ID from SORU_SECENEK_ARATABLO where SECENEK_ID=@secenekId "; dbComm = db.GetSqlStringCommand(sqlText); db.AddInParameter(dbComm, "@secenekId", DbType.Int32, secenekId); using (IDataReader reader = db.ExecuteReader(dbComm)){ if(reader.Read()){ nesne = FillSoruSecenekAratablo(reader); }else nesne=null; } return nesne; }