00001 // /******************************************************************************\ 00002 // * 00003 // * File: QueryField.cpp 00004 // * Creation date: May 17, 2001 14:41 00005 // * Author: ClassBuilder 00006 // * XXXX 00007 // * Purpose: Method implementations of class 'DOQueryField' 00008 // * 00009 // * Modifications: @INSERT_MODIFICATIONS(* ) 00010 // * May 18, 2001 10:27 WERS 00011 // * Updated code of method 'isPriKey' 00012 // * Updated code of method 'isNum' 00013 // * Updated code of method 'isNull' 00014 // * Updated code of method 'GetValue' 00015 // * Updated code of method 'GetName' 00016 // * May 17, 2001 15:15 WERS 00017 // * Added method 'GetValue' 00018 // * May 17, 2001 14:41 WERS 00019 // * Added method 'DestructorInclude' 00020 // * Added method 'ConstructorInclude' 00021 // * Added method 'GetNumber' 00022 // * Added method 'GetName' 00023 // * Added method '~DOQueryField' 00024 // * Added method 'DOQueryField' 00025 // * Added relation 'Query(DOQuery) <>-->> QueryField(DOQueryField)' 00026 // * Added member 'm_number' 00027 // * Added member 'm_pField' 00028 // * 00029 // * 00030 // \******************************************************************************/ 00031 //@START_USER1 00036 /* -------------------------------------------------------------- 00037 Copyright (C) 2001 LifeLine Networks BV <soap2corba@lifeline.nl> 00038 00039 This program is free software; you can redistribute it and/or 00040 modify it under the terms of the GNU General Public License 00041 as published by the Free Software Foundation; either 00042 version 2 of the License, or (at your option) any later 00043 version. 00044 00045 This program is distributed in the hope that it will be useful, 00046 but WITHOUT ANY WARRANTY; without even the implied warranty of 00047 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00048 GNU General Public License for more details. 00049 00050 You should have received a copy of the GNU General Public License 00051 along with this program; if not, write to the Free Software 00052 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00053 -------------------------------------------------------------- */ 00054 //@END_USER1 00055 00056 00057 // Master include file 00058 #include "DbObjects.h" 00059 00060 00061 //@START_USER2 00062 //@END_USER2 00063 00064 00065 // Static members 00066 00067 00071 DOQueryField::DOQueryField(DOQuery* pQuery, unsigned int number, 00072 MYSQL_FIELD* pField) //@INIT_242 00073 : m_pField(pField) 00074 , m_number(number) 00075 {//@CODE_242 00076 ConstructorInclude(pQuery); 00077 00078 // Put in your own code 00079 }//@CODE_242 00080 00081 00085 DOQueryField::~DOQueryField() 00086 {//@CODE_148 00087 DestructorInclude(); 00088 00089 // Put in your own code 00090 }//@CODE_148 00091 00092 00099 CString DOQueryField::GetValue() 00100 {//@CODE_258 00101 CString value; 00102 00103 MYSQL_ROW row = GetQuery()->GetRow(); 00104 if (row && row [m_number]) { 00105 value = row [m_number]; 00106 } 00107 return value; 00108 }//@CODE_258 00109 00110 00111 //{{AFX DO NOT EDIT CODE BELOW THIS LINE !!! 00112 00116 void DOQueryField::ConstructorInclude(DOQuery* pQuery) 00117 { 00118 // INIT_MULTI_OWNED_PASSIVE(DOQuery, Query, DOQueryField, QueryField) 00119 assert(this); 00120 assert(pQuery); 00121 pQuery->_countQueryField++; 00122 00123 _refQuery = pQuery; 00124 00125 if (pQuery->_lastQueryField) 00126 { 00127 _nextQuery = (DOQueryField*)0; 00128 _prevQuery = pQuery->_lastQueryField; 00129 _prevQuery->_nextQuery = this; 00130 pQuery->_lastQueryField = this; 00131 } 00132 else 00133 { 00134 _prevQuery = (DOQueryField*)0; 00135 _nextQuery = (DOQueryField*)0; 00136 pQuery->_firstQueryField = pQuery->_lastQueryField = this; 00137 } 00138 } 00139 00140 00144 void DOQueryField::DestructorInclude() 00145 { 00146 // EXIT_MULTI_OWNED_PASSIVE(DOQuery, Query, DOQueryField, QueryField) 00147 00148 assert(this); 00149 if (_refQuery) 00150 { 00151 DOQuery::QueryFieldIterator::Check(this); 00152 00153 _refQuery->_countQueryField--; 00154 00155 if (_nextQuery) 00156 _nextQuery->_prevQuery = _prevQuery; 00157 else 00158 _refQuery->_lastQueryField = _prevQuery; 00159 00160 if (_prevQuery) 00161 _prevQuery->_nextQuery = _nextQuery; 00162 else 00163 _refQuery->_firstQueryField = _nextQuery; 00164 00165 _prevQuery = (DOQueryField*)0; 00166 _nextQuery = (DOQueryField*)0; 00167 _refQuery = (DOQuery*)0; 00168 } 00169 } 00170 00171 00172 // Methods for the relation(s) of the class 00173 // METHODS_MULTI_OWNED_PASSIVE(DOQuery, Query, DOQueryField, QueryField) 00174 00175 //}}AFX DO NOT EDIT CODE ABOVE THIS LINE !!! 00176 00177 //@START_USER3 00178