void E9_LOG_KAYDI_ARAMA::SEARCH_EDIT_CLICKED ( QWidget * p_widget, QLineEdit * p_line_edit ) { Q_UNUSED ( p_widget ); SQL_QUERY yonetim_query ( G_YONETIM_DB ); int kullanici_id = KULLANICI_SEC ( false, this ); if ( kullanici_id > 0 ) { yonetim_query.PREPARE_SELECT ( "ynt_kullanicilar", "kullanici_kodu, kullanici_adi", "kullanici_id = :kullanici_id" ); yonetim_query.SET_VALUE ( ":kullanici_id", kullanici_id ); if ( yonetim_query.SELECT() EQ 0 ) { return; } yonetim_query.NEXT(); p_line_edit->setText ( yonetim_query.VALUE(0).toString() ); m_ui->lineEdit_kullanici_adi->setText ( yonetim_query.VALUE(1).toString() ); m_kullanici_id = kullanici_id; } }
int E9_LOG_KAYDI_ARAMA::CHECK_VAR ( QObject * p_object ) { if ( p_object EQ m_ui->checkBox_log_turu ) { if ( m_ui->checkBox_log_turu->isChecked() EQ true ) { m_ui->frame_log_turu->setEnabled(true); } else { m_ui->frame_log_turu->setEnabled(false); m_ui->comboBox_log_turu->setCurrentIndex(-1); } } else if ( p_object EQ m_ui->checkBox_kullanici_secimi ) { if ( m_ui->checkBox_kullanici_secimi->isChecked() EQ true ) { m_ui->frame_kullanici_secimi->setEnabled(true); } else { m_ui->frame_kullanici_secimi->setEnabled(false); m_ui->searchEdit_kullanici_kodu->SET_TEXT(""); m_ui->lineEdit_kullanici_adi->clear(); m_kullanici_id = -1; } } else if ( p_object EQ m_ui->searchEdit_kullanici_kodu ) { if ( m_ui->searchEdit_kullanici_kodu->GET_TEXT().isEmpty() EQ true ) { m_ui->lineEdit_kullanici_adi->clear(); m_kullanici_id = -1; return ADAK_OK; } SQL_QUERY yonetim_query ( G_YONETIM_DB ); yonetim_query.PREPARE_SELECT("ynt_kullanicilar ", "kullanici_id, kullanici_adi ", "kullanici_kodu = :kullanici_kodu AND silinmis_mi = 0 "); yonetim_query.SET_VALUE(":kullanici_kodu", m_ui->searchEdit_kullanici_kodu->GET_TEXT() ); if ( yonetim_query.SELECT() EQ 0 ) { MSG_WARNING( tr("Bu kodla kullanıcı bulunamadı."), NULL ); return ADAK_FAIL_UNDO; } yonetim_query.NEXT(); m_kullanici_id = yonetim_query.VALUE(0).toInt(); m_ui->lineEdit_kullanici_adi->setText ( yonetim_query.VALUE(1).toString()); } else if ( p_object EQ m_ui->comboBox_modul_secimi ) { FILL_LOG_TURLERI_COMBOBOX(); } return ADAK_OK; }
bool HEADER_DOSYASI_YARAT( QWidget * parent ) { SQL_QUERY yonetim_query ( G_YONETIM_DB); SQL_QUERY db_query ( DB ); db_query.PREPARE_SELECT ("sql_db_info","program_id"); if ( db_query.SELECT () EQ 0 ) { exit(88); } db_query.NEXT(); int program_id = db_query.VALUE(0).toInt(); yonetim_query.PREPARE_SELECT("ynt_veritabanlari", "veritabani_ismi","veritabani_id = :veritabani_id"); yonetim_query.SET_VALUE(":veritabani_id", VERITABANI_ID()); if ( yonetim_query.SELECT("veritabani_ismi") EQ 0 ) { return false; } yonetim_query.NEXT(); QString db_name = yonetim_query.VALUE(0).toString(); QString file_path = db_name.toLower() + "_db.h"; QFile header_file ( file_path ); header_file.open(QIODevice::WriteOnly | QIODevice::Text); file_content = "#ifndef " + db_name.toUpper() + "_DB_H\n" "#define " + db_name.toUpper() + "_DB_H\n\n"; file_content += nl( "ADAK_SQL_STRUCT " + db_name + "_db" + " = {" ); file_content += tab (1, nl(QVariant(program_id).toString() + ",")); TABLOLARI_YAZ ( parent ); file_content += nl("};"); file_content += "#endif // " + db_name.toUpper() + "_DB_H \n"; header_file.write ( file_content.toLatin1() ); header_file.close(); return true; }