location::location(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_location, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sHandleWarehouse(int))); _locitem->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _locitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip" ); _warehouse->setAllowNull(_metrics->boolean("MultiWhs")); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); sHandleWarehouse(_warehouse->id()); } else _warehouse->setNull(); }
void location::populate() { XSqlQuery locationpopulate; locationpopulate.prepare( "SELECT * " "FROM location " "WHERE (location_id=:location_id);" ); locationpopulate.bindValue(":location_id", _locationid); locationpopulate.exec(); if (locationpopulate.first()) { _aisle->setText(locationpopulate.value("location_aisle").toString()); _rack->setText(locationpopulate.value("location_rack").toString()); _bin->setText(locationpopulate.value("location_bin").toString()); _location->setText(locationpopulate.value("location_name").toString()); _description->setText(locationpopulate.value("location_descrip").toString()); _netable->setChecked(locationpopulate.value("location_netable").toBool()); _restricted->setChecked(locationpopulate.value("location_restrict").toBool()); int whsezoneid = locationpopulate.value("location_whsezone_id").toInt(); _warehouse->setId(locationpopulate.value("location_warehous_id").toInt()); sHandleWarehouse(_warehouse->id()); _whsezone->setId(whsezoneid); sFillList(); } }
location::location(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_location, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sHandleWarehouse(int))); _locitem->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft ); _locitem->addColumn(tr("Description"), -1, Qt::AlignLeft ); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); sHandleWarehouse(_warehouse->id()); } else { _warehouse->setAllowNull(TRUE); _warehouse->setNull(); } }