示例#1
0
 // ---------------------------------------------------------------------------------
 success Project::update ( const dp::Project& _p ) const
 {
   if ( _p.id().isNull())
   {
     return error();
   }
   QSqlQuery query;
   query.prepare ( UPDATE_PROJECT );
   query.addBindValue ( _p.name() );
   query.addBindValue ( _p.creationDate() );
   query.addBindValue( _p.comment() );
   query.addBindValue ( _p.id().toString() );
   return execute ( query );
 }
示例#2
0
 // ---------------------------------------------------------------------------------
 success Project::insert ( dp::Project const& _p ) const
 {
   if ( _p.id().isNull())
   {
     return error();
   }
   QSqlQuery query;
   query.prepare ( INSERT_PROJECT );
   query.addBindValue ( _p.id().toString() );
   query.addBindValue ( _p.name() );
   query.addBindValue ( _p.creationDate() );
   query.addBindValue( _p.comment() );
   if ( execute ( query ).has_failed() )
   {
     return error();
   }
   return successful();
 }