123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- #include "Airport.h"
- #include "regExp.h"
- #include "Dict.h"
- #include "AutoCompleteComBoxWidget.h"
- #include "CheckComboBoxWidget.h"
- #include "charcode.h"
- #include "DebugUtil.h"
- QX_REGISTER_CPP_USER(Airport)
- namespace qx {
- template <>
- void register_class(QxClass<Airport> & t)
- {
- qx::IxDataMember * pData = NULL; Q_UNUSED(pData);
- qx::IxSqlRelation * pRelation = NULL; Q_UNUSED(pRelation);
- qx::IxFunction * pFct = NULL; Q_UNUSED(pFct);
- qx::IxValidator * pValidator = NULL; Q_UNUSED(pValidator);
- t.setName("T_CM_AIRPORT");
- pData = t.id(& Airport::m_ID, "ID", 0);
- pData->setDescription("编号");
- pData->setAutoIncrement(true);
- pData = t.data(& Airport::m_NAME, "NAME", 0, true, true);
- pData->setDescription("名称");
- pData->setRequired(true);
- pData = t.data(& Airport::m_LONGITUDE, "LONGITUDE", 0, true, true);
- pData->setDescription("经度");
- pData->setMaxValue(180.0);
- pData->setMinValue(-180.0);
- pData->setPrecision(6); //默认即是6位
- pData = t.data(& Airport::m_LATITUDE, "LATITUDE", 0, true, true);
- pData->setDescription("纬度");
- pData->setMaxValue(90.0);
- pData->setMinValue(-90.0);
- pData = t.data(& Airport::m_HEIGHT, "HEIGHT", 0, true, true);
- pData->setDescription("高度");
- pData->setPropertyBag("regExp",REGEXP_DOUBLE(4,2));
- pData = t.data(& Airport::m_NATION, "NATION", 0, true, true);
- pData->setDescription("国别");
- pData->setPropertyBag("dict",Dict::nationDict);
- // pData->setPropertyBag("type",AutoCompleteComBoxWidget::type);
- pData->setPropertyBag("type",CheckComboBoxWidget::type);
- pData = t.data(& Airport::m_ISDELETE, "ISDELETE", 0, true, true);
- pData->setDescription("是否删除");
- pData->setPropertyBag("notShow",true);
- pData->setPropertyBag("notInput",true);
- // qx::QxSoftDelete SoftDelete;
- // SoftDelete.setColumnName("ISDELETE");
- // SoftDelete.setMode(qx::QxSoftDelete::mode_flag);
- // t.setSoftDelete(SoftDelete);
- pData = t.data(& Airport::m_IMPORTTIME, "IMPORTTIME", 0, true, true);
- pData->setDescription("更新时间");
- pData->setPropertyBag("notInput",true);
- pData->setPropertyBag("notEditAble",true);
- pData = t.data(& Airport::m_NOTE, "NOTE", 0, true, true);
- pData->setDescription("备注");
- qx::QxValidatorX<Airport> * pAllValidator = t.getAllValidator(); Q_UNUSED(pAllValidator);
- }
- } // namespace qx
- Airport::Airport() : m_ID(0.0), m_LONGITUDE(0.0), m_LATITUDE(0.0), m_HEIGHT(0.0) { ; }
- Airport::Airport(const double & id) : m_ID(id), m_LONGITUDE(0.0), m_LATITUDE(0.0), m_HEIGHT(0.0) { ; }
- Airport::~Airport() { ; }
- double Airport::getID() const { return m_ID; }
- QString Airport::getNAME() const { return m_NAME; }
- double Airport::getLONGITUDE() const { return m_LONGITUDE; }
- double Airport::getLATITUDE() const { return m_LATITUDE; }
- double Airport::getHEIGHT() const { return m_HEIGHT; }
- QString Airport::getNATION() const{ return m_NATION; }
- QString Airport::getISDELETE() const { return m_ISDELETE; }
- QDateTime Airport::getIMPORTTIME() const { return m_IMPORTTIME; }
- QString Airport::getNOTE() const { return m_NOTE; }
- void Airport::setID(const double & val) { m_ID = val; }
- void Airport::setNAME(const QString & val) { m_NAME = val; }
- void Airport::setLONGITUDE(const double & val) { m_LONGITUDE = val; }
- void Airport::setLATITUDE(const double & val) { m_LATITUDE = val; }
- void Airport::setHEIGHT(const double & val) { m_HEIGHT = val; }
- void Airport::setNATION(const QString & val) { m_NATION = val; }
- void Airport::setISDELETE(const QString & val) { m_ISDELETE = val; }
- void Airport::setIMPORTTIME(const QDateTime & val) { m_IMPORTTIME = val; }
- void Airport::setNOTE(const QString & val) { m_NOTE = val; }
- void Airport::onBeforeFetch(qx::dao::detail::IxDao_Helper *dao)
- {
- qDebug() << "onBeforeFetch **********************";
- Debug(dao->query().executedQuery());
- }
- void Airport::onAfterFetch(qx::dao::detail::IxDao_Helper *dao)
- {
- qDebug() << "onAfterFetch **********************";
- Debug(dao->query().executedQuery());
- }
|