/** * Load a single Manufacturer object, * by ManufacturerId Index(es) * @param integer $intManufacturerId * @return Manufacturer */ public static function LoadByManufacturerId($intManufacturerId) { return Manufacturer::QuerySingle(QQ::Equal(QQN::Manufacturer()->ManufacturerId, $intManufacturerId)); }
/** * Load a single Manufacturer object, * by ManufacturerId Index(es) * @param integer $intManufacturerId * @return Manufacturer */ public static function LoadByManufacturerId($intManufacturerId, $objOptionalClauses = null) { return Manufacturer::QuerySingle(QQ::Equal(QQN::Manufacturer()->ManufacturerId, $intManufacturerId), $objOptionalClauses); }
protected function btnQuickAdd_Click($strFormId, $strControlId, $strParameter) { $blnError = false; $this->btnQuickAdd->Warning = ''; if (strlen(trim($this->txtQuickAdd->Text)) == 0) { $blnError = true; $this->btnQuickAdd->Warning = 'You must enter a Manufacturer name'; } // Check for dupes $objManufacturerDuplicate = Manufacturer::QuerySingle(QQ::Equal(QQN::Manufacturer()->ShortDescription, $this->txtQuickAdd->Text)); if ($objManufacturerDuplicate) { $blnError = true; $this->btnQuickAdd->Warning = 'This Manufacturer Name is already in use. Please try another.'; } if (!$blnError) { $objManufacturer = new Manufacturer(); $objManufacturer->ShortDescription = $this->txtQuickAdd->Text; $objManufacturer->CreatedBy = QApplication::$objUserAccount->UserAccountId; $objManufacturer->CreationDate = QDateTime::Now(); $objManufacturer->Save(); $this->dtgManufacturer->Refresh(); $this->txtQuickAdd->Text = ''; } $this->txtQuickAdd->Focus(); $this->txtQuickAdd->Select(); }