Beispiel #1
0
DBOp_Angebot::DBOp_Angebot( QString Id, QWidget *parent ) :
    QDialog( parent ), ui( new Ui::DBOp_Angebot )
{
    ui->setupUi( this );

    aId = Id;
    getStandorte( );
    getProdukte( );
    QPushButton *applyButton = ui->buttonBox->button( QDialogButtonBox::Apply );
    if( aId == "0" )
    {
        getAutoID( );
        connect( applyButton, SIGNAL(clicked()), this, SLOT(insertAngebot()) );
        connect( ui->buttonBox, SIGNAL(accepted()), this, SLOT(insertAngebot()) );
        this->setWindowIcon( QIcon(QString("db_add.png")) );
    }
    else
    {
        getAngebot( );
        getPositionen( );
        connect( applyButton, SIGNAL(clicked()), this, SLOT(updateAngebot()) );
        connect( ui->buttonBox, SIGNAL(accepted()), this, SLOT(updateAngebot()) );
        this->setWindowIcon( QIcon(QString("db_edit.png")) );
    }
    getPositionID( );
    setRabatt( );
    setTagespreis( );
    connect( ui->pushNeuS, SIGNAL(clicked()), this, SLOT(neuStandort()) );
    connect( ui->pushNeuP, SIGNAL(clicked()), this, SLOT(neuProdukt()) );
    connect( ui->doubleFirmenRabatt, SIGNAL(valueChanged(double)), this, SLOT(setRabatt()) );
    connect( ui->pushPositionHinzufuegen, SIGNAL(clicked()), this, SLOT(insertPosition()) );
    connect( ui->pushPositionEntfernen, SIGNAL(clicked()), this, SLOT(removePosition()) );
    connect( ui->comboProduktID, SIGNAL(currentIndexChanged(int)), this, SLOT(setTagespreis()) );
}
void PositionMonitorManager::checkPosition(const std::string & symbol)
{
    PositionsMapIter iter = positions_.find(symbol);
    if(iter != positions_.end())
    {
		PositionMonitor * posMon = (*iter).second;
		if(posMon->status() == DataEnums::CloseFilled)
		{
			removePosition(symbol);
			PositionManager::instance()->positionClosed(symbol);
		}
		else
		{
			posMon->checkPosition();
		}
    }
}