protected function dtgAuthorizationLevel_Bind()
 {
     // Because we want to enable pagination AND sorting, we need to setup the $objClauses array to send to LoadAll()
     // Remember!  We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     $this->dtgAuthorizationLevel->TotalItemCount = AuthorizationLevel::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->dtgAuthorizationLevel->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->dtgAuthorizationLevel->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be the array of all AuthorizationLevel objects, given the clauses above
     $this->dtgAuthorizationLevel->DataSource = AuthorizationLevel::LoadAll($objClauses);
 }
 /**
  * Refresh this MetaControl with Data from the local RoleModuleAuthorization object.
  * @param boolean $blnReload reload RoleModuleAuthorization from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objRoleModuleAuthorization->Reload();
     }
     if ($this->lblRoleModuleAuthorizationId) {
         if ($this->blnEditMode) {
             $this->lblRoleModuleAuthorizationId->Text = $this->objRoleModuleAuthorization->RoleModuleAuthorizationId;
         }
     }
     if ($this->lstRoleModule) {
         $this->lstRoleModule->RemoveAllItems();
         $this->lstRoleModule->AddItem(QApplication::Translate('- Select One -'), null);
         $objRoleModuleArray = RoleModule::LoadAll();
         if ($objRoleModuleArray) {
             foreach ($objRoleModuleArray as $objRoleModule) {
                 $objListItem = new QListItem($objRoleModule->__toString(), $objRoleModule->RoleModuleId);
                 if ($this->objRoleModuleAuthorization->RoleModule && $this->objRoleModuleAuthorization->RoleModule->RoleModuleId == $objRoleModule->RoleModuleId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstRoleModule->AddItem($objListItem);
             }
         }
     }
     if ($this->lblRoleModuleId) {
         $this->lblRoleModuleId->Text = $this->objRoleModuleAuthorization->RoleModule ? $this->objRoleModuleAuthorization->RoleModule->__toString() : null;
     }
     if ($this->lstAuthorization) {
         $this->lstAuthorization->RemoveAllItems();
         $this->lstAuthorization->AddItem(QApplication::Translate('- Select One -'), null);
         $objAuthorizationArray = Authorization::LoadAll();
         if ($objAuthorizationArray) {
             foreach ($objAuthorizationArray as $objAuthorization) {
                 $objListItem = new QListItem($objAuthorization->__toString(), $objAuthorization->AuthorizationId);
                 if ($this->objRoleModuleAuthorization->Authorization && $this->objRoleModuleAuthorization->Authorization->AuthorizationId == $objAuthorization->AuthorizationId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstAuthorization->AddItem($objListItem);
             }
         }
     }
     if ($this->lblAuthorizationId) {
         $this->lblAuthorizationId->Text = $this->objRoleModuleAuthorization->Authorization ? $this->objRoleModuleAuthorization->Authorization->__toString() : null;
     }
     if ($this->lstAuthorizationLevel) {
         $this->lstAuthorizationLevel->RemoveAllItems();
         $this->lstAuthorizationLevel->AddItem(QApplication::Translate('- Select One -'), null);
         $objAuthorizationLevelArray = AuthorizationLevel::LoadAll();
         if ($objAuthorizationLevelArray) {
             foreach ($objAuthorizationLevelArray as $objAuthorizationLevel) {
                 $objListItem = new QListItem($objAuthorizationLevel->__toString(), $objAuthorizationLevel->AuthorizationLevelId);
                 if ($this->objRoleModuleAuthorization->AuthorizationLevel && $this->objRoleModuleAuthorization->AuthorizationLevel->AuthorizationLevelId == $objAuthorizationLevel->AuthorizationLevelId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstAuthorizationLevel->AddItem($objListItem);
             }
         }
     }
     if ($this->lblAuthorizationLevelId) {
         $this->lblAuthorizationLevelId->Text = $this->objRoleModuleAuthorization->AuthorizationLevel ? $this->objRoleModuleAuthorization->AuthorizationLevel->__toString() : null;
     }
     if ($this->lstCreatedByObject) {
         $this->lstCreatedByObject->RemoveAllItems();
         $this->lstCreatedByObject->AddItem(QApplication::Translate('- Select One -'), null);
         $objCreatedByObjectArray = UserAccount::LoadAll();
         if ($objCreatedByObjectArray) {
             foreach ($objCreatedByObjectArray as $objCreatedByObject) {
                 $objListItem = new QListItem($objCreatedByObject->__toString(), $objCreatedByObject->UserAccountId);
                 if ($this->objRoleModuleAuthorization->CreatedByObject && $this->objRoleModuleAuthorization->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstCreatedByObject->AddItem($objListItem);
             }
         }
     }
     if ($this->lblCreatedBy) {
         $this->lblCreatedBy->Text = $this->objRoleModuleAuthorization->CreatedByObject ? $this->objRoleModuleAuthorization->CreatedByObject->__toString() : null;
     }
     if ($this->calCreationDate) {
         $this->calCreationDate->DateTime = $this->objRoleModuleAuthorization->CreationDate;
     }
     if ($this->lblCreationDate) {
         $this->lblCreationDate->Text = sprintf($this->objRoleModuleAuthorization->CreationDate) ? $this->objRoleModuleAuthorization->__toString($this->strCreationDateDateTimeFormat) : null;
     }
     if ($this->lstModifiedByObject) {
         $this->lstModifiedByObject->RemoveAllItems();
         $this->lstModifiedByObject->AddItem(QApplication::Translate('- Select One -'), null);
         $objModifiedByObjectArray = UserAccount::LoadAll();
         if ($objModifiedByObjectArray) {
             foreach ($objModifiedByObjectArray as $objModifiedByObject) {
                 $objListItem = new QListItem($objModifiedByObject->__toString(), $objModifiedByObject->UserAccountId);
                 if ($this->objRoleModuleAuthorization->ModifiedByObject && $this->objRoleModuleAuthorization->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstModifiedByObject->AddItem($objListItem);
             }
         }
     }
     if ($this->lblModifiedBy) {
         $this->lblModifiedBy->Text = $this->objRoleModuleAuthorization->ModifiedByObject ? $this->objRoleModuleAuthorization->ModifiedByObject->__toString() : null;
     }
     if ($this->lblModifiedDate) {
         if ($this->blnEditMode) {
             $this->lblModifiedDate->Text = $this->objRoleModuleAuthorization->ModifiedDate;
         }
     }
 }
 protected function lstAuthorizationLevel_Create()
 {
     $this->lstAuthorizationLevel = new QListBox($this);
     $this->lstAuthorizationLevel->Name = QApplication::Translate('Authorization Level');
     $this->lstAuthorizationLevel->AddItem(QApplication::Translate('- Select One -'), null);
     $objAuthorizationLevelArray = AuthorizationLevel::LoadAll();
     if ($objAuthorizationLevelArray) {
         foreach ($objAuthorizationLevelArray as $objAuthorizationLevel) {
             $objListItem = new QListItem($objAuthorizationLevel->__toString(), $objAuthorizationLevel->AuthorizationLevelId);
             if ($this->objRoleModuleAuthorization->AuthorizationLevel && $this->objRoleModuleAuthorization->AuthorizationLevel->AuthorizationLevelId == $objAuthorizationLevel->AuthorizationLevelId) {
                 $objListItem->Selected = true;
             }
             $this->lstAuthorizationLevel->AddItem($objListItem);
         }
     }
 }
 public function dtgAuthorizationLevel_Bind()
 {
     // Get Total Count b/c of Pagination
     $this->dtgAuthorizationLevel->TotalItemCount = AuthorizationLevel::CountAll();
     $objClauses = array();
     if ($objClause = $this->dtgAuthorizationLevel->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     if ($objClause = $this->dtgAuthorizationLevel->LimitClause) {
         array_push($objClauses, $objClause);
     }
     $this->dtgAuthorizationLevel->DataSource = AuthorizationLevel::LoadAll($objClauses);
 }