int KULLANICILAR_FORMU::CHECK_UPDATE (int p_kullanici_id )
{
    SQL_QUERY sql_query ( G_YONETIM_DB );
    sql_query.PREPARE_SELECT ( "ynt_kullanicilar","kullanici_id","kullanici_kodu = :kullanici_kodu "
                               "AND silinmis_mi = :silinmis_mi ","" );

    sql_query.SET_VALUE      ( ":kullanici_kodu" , m_ui->lineEdit_kullanici_kodu->text() );
    sql_query.SET_VALUE      ( ":silinmis_mi"   ,0 );

    if ( sql_query.SELECT() > 0 ) {

        sql_query.NEXT();
        if ( sql_query.VALUE(0).toInt() NE p_kullanici_id ) {
            MSG_ERROR(tr ( "There are registered users in the system with this code." )  , NULL);//bu kodla kullanıcı sistemde mevcut
            return ADAK_FAIL;
        }
    }

    if ( m_ui->check_box_sifre->isChecked() EQ true ) {
        if ( m_ui->line_edit_yeni_sifre->text() NE m_ui->line_edit_yeni_sifre_tekrar->text() ) {
            MSG_ERROR("New and repeat passwords do not match,Please check.",m_ui->line_edit_yeni_sifre);//Girdiğiniz yeni şifre ve tekrarı uyuşmuyor Lütfen kontrol ediniz.
            return ADAK_FAIL;
        }
    }

    ADAK_MSG_ENUM answer = MSG_YES_NO_CANCEL( tr ( "Do you approve of the changes you made?" ) , NULL);//Yapılan değişiklikleri onaylıyor musunuz?
    if ( answer EQ ADAK_CANCEL OR answer EQ ADAK_NO  ) {
        return ADAK_FAIL;
    }
    return ADAK_OK;

}
Exemple #2
0
int SQL_TABLOLAR_FISI::CHECK_FIS_RECORD_DELETE ( int p_tablo_id )
{
    Q_UNUSED ( p_tablo_id );

    if ( KAYIT_SILME_YETKISI_VAR_MI( KULLANICI_ID() ) EQ 0 ) {
        MSG_ERROR(tr("This user has no authority to delete records."),m_ui->lineEdit_tablo_adi);//Bu kullanıcının kayıt silme yetkisi yok"
        return ADAK_FAIL;
    }

    ADAK_MSG_ENUM answer = MSG_YES_NO_CANCEL(tr("Table will be deleted with all field definitions!"),m_ui->lineEdit_tablo_adi);//Tablo tüm alan tanımlarıyla beraber silinecektir!

    if ( answer EQ ADAK_NO OR answer EQ ADAK_CANCEL ) {
        return ADAK_FAIL;
    }
    return ADAK_OK;
}