/**
  * 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 = Word::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 Word, given the clauses above
     $this->DataSource = Word::LoadAll($objClauses);
 }
 /**
  * Refresh this MetaControl with Data from the local WordStatusLog object.
  * @param boolean $blnReload reload WordStatusLog from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objWordStatusLog->Reload();
     }
     if ($this->lblWordStatusLogId) {
         if ($this->blnEditMode) {
             $this->lblWordStatusLogId->Text = $this->objWordStatusLog->WordStatusLogId;
         }
     }
     if ($this->lstWord) {
         $this->lstWord->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstWord->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objWordArray = Word::LoadAll();
         if ($objWordArray) {
             foreach ($objWordArray as $objWord) {
                 $objListItem = new QListItem($objWord->__toString(), $objWord->WordId);
                 if ($this->objWordStatusLog->Word && $this->objWordStatusLog->Word->WordId == $objWord->WordId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstWord->AddItem($objListItem);
             }
         }
     }
     if ($this->lblWordId) {
         $this->lblWordId->Text = $this->objWordStatusLog->Word ? $this->objWordStatusLog->Word->__toString() : null;
     }
     if ($this->lstStatusType) {
         $this->lstStatusType->SelectedValue = $this->objWordStatusLog->StatusTypeId;
     }
     if ($this->lblStatusTypeId) {
         $this->lblStatusTypeId->Text = $this->objWordStatusLog->StatusTypeId ? StatusType::$NameArray[$this->objWordStatusLog->StatusTypeId] : null;
     }
     if ($this->txtChangedBy) {
         $this->txtChangedBy->Text = $this->objWordStatusLog->ChangedBy;
     }
     if ($this->lblChangedBy) {
         $this->lblChangedBy->Text = $this->objWordStatusLog->ChangedBy;
     }
     if ($this->calChangedAt) {
         $this->calChangedAt->DateTime = $this->objWordStatusLog->ChangedAt;
     }
     if ($this->lblChangedAt) {
         $this->lblChangedAt->Text = sprintf($this->objWordStatusLog->ChangedAt) ? $this->objWordStatusLog->ChangedAt->__toString($this->strChangedAtDateTimeFormat) : null;
     }
 }
 /**
  * Refresh this MetaControl with Data from the local SentLog object.
  * @param boolean $blnReload reload SentLog from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objSentLog->Reload();
     }
     if ($this->lblWordSentLogId) {
         if ($this->blnEditMode) {
             $this->lblWordSentLogId->Text = $this->objSentLog->WordSentLogId;
         }
     }
     if ($this->txtIpAddress) {
         $this->txtIpAddress->Text = $this->objSentLog->IpAddress;
     }
     if ($this->lblIpAddress) {
         $this->lblIpAddress->Text = $this->objSentLog->IpAddress;
     }
     if ($this->txtUserAgent) {
         $this->txtUserAgent->Text = $this->objSentLog->UserAgent;
     }
     if ($this->lblUserAgent) {
         $this->lblUserAgent->Text = $this->objSentLog->UserAgent;
     }
     if ($this->calDateSent) {
         $this->calDateSent->DateTime = $this->objSentLog->DateSent;
     }
     if ($this->lblDateSent) {
         $this->lblDateSent->Text = sprintf($this->objSentLog->DateSent) ? $this->objSentLog->DateSent->__toString($this->strDateSentDateTimeFormat) : null;
     }
     if ($this->lstWord) {
         $this->lstWord->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstWord->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objWordArray = Word::LoadAll();
         if ($objWordArray) {
             foreach ($objWordArray as $objWord) {
                 $objListItem = new QListItem($objWord->__toString(), $objWord->WordId);
                 if ($this->objSentLog->Word && $this->objSentLog->Word->WordId == $objWord->WordId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstWord->AddItem($objListItem);
             }
         }
     }
     if ($this->lblWordId) {
         $this->lblWordId->Text = $this->objSentLog->Word ? $this->objSentLog->Word->__toString() : null;
     }
 }