/**
  * Create and setup QListBox lstReferenceIDObject
  * @param string $strControlId optional ControlId to use
  * @return QListBox
  */
 public function lstReferenceIDObject_Create($strControlId = null)
 {
     $this->lstReferenceIDObject = new QListBox($this->objParentObject, $strControlId);
     $this->lstReferenceIDObject->Name = QApplication::Translate('Reference I D Object');
     $this->lstReferenceIDObject->AddItem(QApplication::Translate('- Select One -'), null);
     $objReferenceIDObjectArray = Articlecore::LoadArrayByProductGroup('9');
     if ($objReferenceIDObjectArray) {
         foreach ($objReferenceIDObjectArray as $objReferenceIDObject) {
             $objListItem = new QListItem($objReferenceIDObject->__toString(), $objReferenceIDObject->Id);
             if ($this->objArticlebook->ReferenceIDObject && $this->objArticlebook->ReferenceIDObject->Id == $objReferenceIDObject->Id) {
                 $objListItem->Selected = true;
             }
             $this->lstReferenceIDObject->AddItem($objListItem);
         }
     }
     return $this->lstReferenceIDObject;
 }
 /**
  * Create and setup QListBox lstReferenceIdObject
  * @param string $strControlId optional ControlId to use
  * @return QListBox
  */
 public function lstReferenceIDObject_Create($strControlId = null)
 {
     $this->lstReferenceIDObject = new QListBox($this->objParentObject, $strControlId);
     $this->lstReferenceIDObject->Name = QApplication::Translate('Reference Id Object');
     $this->lstReferenceIDObject->Required = true;
     if (!$this->blnEditMode) {
         $this->lstReferenceIDObject->AddItem(QApplication::Translate('- Select One -'), null);
     }
     $productgroupid = Articlecategory::QuerySingle(QQ::Equal(QQN::Articlecategory()->AmazonCode, 'DVD'));
     $objReferenceIDObjectArray = Articlecore::LoadArrayByProductGroup($productgroupid->Id);
     if ($objReferenceIDObjectArray) {
         foreach ($objReferenceIDObjectArray as $objReferenceIDObject) {
             $objListItem = new QListItem($objReferenceIDObject->__toString(), $objReferenceIDObject->Id);
             if ($this->objArticlemovies->ReferenceIDObject && $this->objArticlemovies->ReferenceIDObject->Id == $objReferenceIDObject->Id) {
                 $objListItem->Selected = true;
             }
             $this->lstReferenceIDObject->AddItem($objListItem);
         }
     }
     return $this->lstReferenceIDObject;
 }
Exemplo n.º 3
0
 /**
  * Load a single Articlecore object,
  * by ASIN Index(es)
  * @param integer $intId
  * @return Articlecore
  */
 public static function LoadByASIN($strASIN)
 {
     return Articlecore::QuerySingle(QQ::Equal(QQN::Articlecore()->Asin, $strASIN));
 }
 /**
  * Refresh this MetaControl with Data from the local Articlemovies object.
  * @param boolean $blnReload reload Articlemovies from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objArticlemovies->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objArticlemovies->Id;
         }
     }
     if ($this->lstReferenceIDObject) {
         $this->lstReferenceIDObject->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstReferenceIDObject->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objReferenceIDObjectArray = Articlecore::LoadAll();
         if ($objReferenceIDObjectArray) {
             foreach ($objReferenceIDObjectArray as $objReferenceIDObject) {
                 $objListItem = new QListItem($objReferenceIDObject->__toString(), $objReferenceIDObject->Id);
                 if ($this->objArticlemovies->ReferenceIDObject && $this->objArticlemovies->ReferenceIDObject->Id == $objReferenceIDObject->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstReferenceIDObject->AddItem($objListItem);
             }
         }
     }
     if ($this->lblReferenceID) {
         $this->lblReferenceID->Text = $this->objArticlemovies->ReferenceIDObject ? $this->objArticlemovies->ReferenceIDObject->__toString() : null;
     }
     if ($this->txtActor) {
         $this->txtActor->Text = $this->objArticlemovies->Actor;
     }
     if ($this->lblActor) {
         $this->lblActor->Text = $this->objArticlemovies->Actor;
     }
     if ($this->txtDirector) {
         $this->txtDirector->Text = $this->objArticlemovies->Director;
     }
     if ($this->lblDirector) {
         $this->lblDirector->Text = $this->objArticlemovies->Director;
     }
     if ($this->txtRunningTime) {
         $this->txtRunningTime->Text = $this->objArticlemovies->RunningTime;
     }
     if ($this->lblRunningTime) {
         $this->lblRunningTime->Text = $this->objArticlemovies->RunningTime;
     }
 }
Exemplo n.º 5
0
 public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects)
 {
     if ($objObject->objReferenceIDObject) {
         $objObject->objReferenceIDObject = Articlecore::GetSoapObjectFromObject($objObject->objReferenceIDObject, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intReferenceID = null;
         }
     }
     return $objObject;
 }
 /**
  * Default / simple DataBinder for this Meta DataGrid.  This can easily be overridden
  * by calling SetDataBinder() on this DataGrid with another DataBinder of your choice.
  *
  * If a paginator is set on this DataBinder, it will use it.  If not, then no pagination will be used.
  * It will also perform any sorting (if applicable).
  */
 public function MetaDataBinder()
 {
     // Remember!  We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     if ($this->Paginator) {
         $this->TotalItemCount = Articlecore::CountAll();
     }
     // Setup the $objClauses Array
     $objClauses = array();
     // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
     // the OrderByClause to the $objClauses array
     if ($objClause = $this->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be a Query result from Articlecore, given the clauses above
     $this->DataSource = Articlecore::LoadAll($objClauses);
 }
 /**
  * Refresh this MetaControl with Data from the local Articlebook object.
  * @param boolean $blnReload reload Articlebook from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objArticlebook->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objArticlebook->Id;
         }
     }
     if ($this->lstReferenceIDObject) {
         $this->lstReferenceIDObject->RemoveAllItems();
         $this->lstReferenceIDObject->AddItem(QApplication::Translate('- Select One -'), null);
         $objReferenceIDObjectArray = Articlecore::LoadAll();
         if ($objReferenceIDObjectArray) {
             foreach ($objReferenceIDObjectArray as $objReferenceIDObject) {
                 $objListItem = new QListItem($objReferenceIDObject->__toString(), $objReferenceIDObject->Id);
                 if ($this->objArticlebook->ReferenceIDObject && $this->objArticlebook->ReferenceIDObject->Id == $objReferenceIDObject->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstReferenceIDObject->AddItem($objListItem);
             }
         }
     }
     if ($this->lblReferenceID) {
         $this->lblReferenceID->Text = $this->objArticlebook->ReferenceIDObject ? $this->objArticlebook->ReferenceIDObject->__toString() : null;
     }
     if ($this->txtAuthor) {
         $this->txtAuthor->Text = $this->objArticlebook->Author;
     }
     if ($this->lblAuthor) {
         $this->lblAuthor->Text = $this->objArticlebook->Author;
     }
     if ($this->txtEdition) {
         $this->txtEdition->Text = $this->objArticlebook->Edition;
     }
     if ($this->lblEdition) {
         $this->lblEdition->Text = $this->objArticlebook->Edition;
     }
     if ($this->txtNumberOfPages) {
         $this->txtNumberOfPages->Text = $this->objArticlebook->NumberOfPages;
     }
     if ($this->lblNumberOfPages) {
         $this->lblNumberOfPages->Text = $this->objArticlebook->NumberOfPages;
     }
     if ($this->calPublicationDate) {
         $this->calPublicationDate->DateTime = $this->objArticlebook->PublicationDate;
     }
     if ($this->lblPublicationDate) {
         $this->lblPublicationDate->Text = sprintf($this->objArticlebook->PublicationDate) ? $this->objArticlebook->__toString($this->strPublicationDateDateTimeFormat) : null;
     }
     if ($this->txtPublisher) {
         $this->txtPublisher->Text = $this->objArticlebook->Publisher;
     }
     if ($this->lblPublisher) {
         $this->lblPublisher->Text = $this->objArticlebook->Publisher;
     }
     if ($this->txtIsbn) {
         $this->txtIsbn->Text = $this->objArticlebook->Isbn;
     }
     if ($this->lblIsbn) {
         $this->lblIsbn->Text = $this->objArticlebook->Isbn;
     }
 }
Exemplo n.º 8
0
 public static function GetSoapArrayFromArray($objArray)
 {
     if (!$objArray) {
         return null;
     }
     $objArrayToReturn = array();
     foreach ($objArray as $objObject) {
         array_push($objArrayToReturn, Articlecore::GetSoapObjectFromObject($objObject, true));
     }
     return unserialize(serialize($objArrayToReturn));
 }
 /**
  * Refresh this MetaControl with Data from the local Articlemusic object.
  * @param boolean $blnReload reload Articlemusic from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objArticlemusic->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objArticlemusic->Id;
         }
     }
     if ($this->lstReferenceIDObject) {
         $this->lstReferenceIDObject->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstReferenceIDObject->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objReferenceIDObjectArray = Articlecore::LoadAll();
         if ($objReferenceIDObjectArray) {
             foreach ($objReferenceIDObjectArray as $objReferenceIDObject) {
                 $objListItem = new QListItem($objReferenceIDObject->__toString(), $objReferenceIDObject->Id);
                 if ($this->objArticlemusic->ReferenceIDObject && $this->objArticlemusic->ReferenceIDObject->Id == $objReferenceIDObject->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstReferenceIDObject->AddItem($objListItem);
             }
         }
     }
     if ($this->lblReferenceID) {
         $this->lblReferenceID->Text = $this->objArticlemusic->ReferenceIDObject ? $this->objArticlemusic->ReferenceIDObject->__toString() : null;
     }
     if ($this->txtArtist) {
         $this->txtArtist->Text = $this->objArticlemusic->Artist;
     }
     if ($this->lblArtist) {
         $this->lblArtist->Text = $this->objArticlemusic->Artist;
     }
     if ($this->txtLabel) {
         $this->txtLabel->Text = $this->objArticlemusic->Label;
     }
     if ($this->lblLabel) {
         $this->lblLabel->Text = $this->objArticlemusic->Label;
     }
     if ($this->txtNumberOfDiscs) {
         $this->txtNumberOfDiscs->Text = $this->objArticlemusic->NumberOfDiscs;
     }
     if ($this->lblNumberOfDiscs) {
         $this->lblNumberOfDiscs->Text = $this->objArticlemusic->NumberOfDiscs;
     }
     if ($this->calReleaseDate) {
         $this->calReleaseDate->DateTime = $this->objArticlemusic->ReleaseDate;
     }
     if ($this->lblReleaseDate) {
         $this->lblReleaseDate->Text = sprintf($this->objArticlemusic->ReleaseDate) ? $this->objArticlemusic->__toString($this->strReleaseDateDateTimeFormat) : null;
     }
 }
Exemplo n.º 10
0
 public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects)
 {
     if ($objObject->objReferenceIDObject) {
         $objObject->objReferenceIDObject = Articlecore::GetSoapObjectFromObject($objObject->objReferenceIDObject, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intReferenceID = null;
         }
     }
     if ($objObject->dttPublicationDate) {
         $objObject->dttPublicationDate = $objObject->dttPublicationDate->__toString(QDateTime::FormatSoap);
     }
     return $objObject;
 }
 /**
  * Static Helper Method to Create using PK arguments
  * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
  * edit, or if we are also allowed to create a new one, etc.
  * 
  * @param mixed $objParentObject QForm or QPanel which will be using this ArticlecoreMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing Articlecore object creation - defaults to CreateOrEdit
  * @return ArticlecoreMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objArticlecore = Articlecore::Load($intId);
         // Articlecore was found -- return it!
         if ($objArticlecore) {
             return new ArticlecoreMetaControl($objParentObject, $objArticlecore);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a Articlecore object with PK arguments: ' . $intId);
             }
         }
         // If EditOnly is specified, throw an exception
     } else {
         if ($intCreateType == QMetaControlCreateType::EditOnly) {
             throw new QCallerException('No PK arguments specified');
         }
     }
     // If we are here, then we need to create a new record
     return new ArticlecoreMetaControl($objParentObject, new Articlecore());
 }