protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgAuthorizationLevel_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colAuthorizationLevelId = new QDataGridColumn(QApplication::Translate('Authorization Level Id'), '<?= $_ITEM->AuthorizationLevelId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::AuthorizationLevel()->AuthorizationLevelId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AuthorizationLevel()->AuthorizationLevelId, false)));
     $this->colShortDescription = new QDataGridColumn(QApplication::Translate('Short Description'), '<?= QString::Truncate($_ITEM->ShortDescription, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AuthorizationLevel()->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AuthorizationLevel()->ShortDescription, false)));
     // Setup DataGrid
     $this->dtgAuthorizationLevel = new QDataGrid($this);
     $this->dtgAuthorizationLevel->CellSpacing = 0;
     $this->dtgAuthorizationLevel->CellPadding = 4;
     $this->dtgAuthorizationLevel->BorderStyle = QBorderStyle::Solid;
     $this->dtgAuthorizationLevel->BorderWidth = 1;
     $this->dtgAuthorizationLevel->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgAuthorizationLevel->Paginator = new QPaginator($this->dtgAuthorizationLevel);
     $this->dtgAuthorizationLevel->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgAuthorizationLevel->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgAuthorizationLevel->SetDataBinder('dtgAuthorizationLevel_Bind');
     $this->dtgAuthorizationLevel->AddColumn($this->colEditLinkColumn);
     $this->dtgAuthorizationLevel->AddColumn($this->colAuthorizationLevelId);
     $this->dtgAuthorizationLevel->AddColumn($this->colShortDescription);
 }
 public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null)
 {
     // Call the Parent
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Record Method Callbacks
     $this->strSetEditPanelMethod = $strSetEditPanelMethod;
     $this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_CONTROL->ParentControl->dtgAuthorizationLevel_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colAuthorizationLevelId = new QDataGridColumn(QApplication::Translate('Authorization Level Id'), '<?= $_ITEM->AuthorizationLevelId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::AuthorizationLevel()->AuthorizationLevelId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AuthorizationLevel()->AuthorizationLevelId, false)));
     $this->colShortDescription = new QDataGridColumn(QApplication::Translate('Short Description'), '<?= QString::Truncate($_ITEM->ShortDescription, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AuthorizationLevel()->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AuthorizationLevel()->ShortDescription, false)));
     // Setup DataGrid
     $this->dtgAuthorizationLevel = new QDataGrid($this);
     $this->dtgAuthorizationLevel->CellSpacing = 0;
     $this->dtgAuthorizationLevel->CellPadding = 4;
     $this->dtgAuthorizationLevel->BorderStyle = QBorderStyle::Solid;
     $this->dtgAuthorizationLevel->BorderWidth = 1;
     $this->dtgAuthorizationLevel->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgAuthorizationLevel->Paginator = new QPaginator($this->dtgAuthorizationLevel);
     $this->dtgAuthorizationLevel->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgAuthorizationLevel->UseAjax = true;
     // Specify the local databind method this datagrid will use
     $this->dtgAuthorizationLevel->SetDataBinder('dtgAuthorizationLevel_Bind', $this);
     $this->dtgAuthorizationLevel->AddColumn($this->colEditLinkColumn);
     $this->dtgAuthorizationLevel->AddColumn($this->colAuthorizationLevelId);
     $this->dtgAuthorizationLevel->AddColumn($this->colShortDescription);
     // Setup the Create New button
     $this->btnCreateNew = new QButton($this);
     $this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('AuthorizationLevel');
     $this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
 }
 /**
  * Used internally by the Meta-based Add Column tools.
  *
  * Given a QQNode or a Text String, this will return a AuthorizationLevel-based QQNode.
  * It will also verify that it is a proper AuthorizationLevel-based QQNode, and will throw an exception otherwise.
  *
  * @param mixed $mixContent
  * @return QQNode
  */
 protected function ResolveContentItem($mixContent)
 {
     if ($mixContent instanceof QQNode) {
         if (!$mixContent->_ParentNode) {
             throw new QCallerException('Content QQNode cannot be a Top Level Node');
         }
         if ($mixContent->_RootTableName == 'authorization_level') {
             if ($mixContent instanceof QQReverseReferenceNode && !$mixContent->_PropertyName) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             }
             $objCurrentNode = $mixContent;
             while ($objCurrentNode = $objCurrentNode->_ParentNode) {
                 if (!$objCurrentNode instanceof QQNode) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
                 if ($objCurrentNode instanceof QQReverseReferenceNode && !$objCurrentNode->_PropertyName) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
             }
             return $mixContent;
         } else {
             throw new QCallerException('Content QQNode has a root table of "' . $mixContent->_RootTableName . '". Must be a root of "authorization_level".');
         }
     } else {
         if (is_string($mixContent)) {
             switch ($mixContent) {
                 case 'AuthorizationLevelId':
                     return QQN::AuthorizationLevel()->AuthorizationLevelId;
                 case 'ShortDescription':
                     return QQN::AuthorizationLevel()->ShortDescription;
                 default:
                     throw new QCallerException('Simple Property not found in AuthorizationLevelDataGrid content: ' . $mixContent);
             }
         } else {
             if ($mixContent instanceof QQAssociationNode) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             } else {
                 throw new QCallerException('Invalid Content type');
             }
         }
     }
 }
 /**
  * Load a single AuthorizationLevel object,
  * by AuthorizationLevelId Index(es)
  * @param integer $intAuthorizationLevelId
  * @return AuthorizationLevel
  */
 public static function LoadByAuthorizationLevelId($intAuthorizationLevelId)
 {
     return AuthorizationLevel::QuerySingle(QQ::Equal(QQN::AuthorizationLevel()->AuthorizationLevelId, $intAuthorizationLevelId));
 }
 /**
  * Load a single AuthorizationLevel object,
  * by AuthorizationLevelId Index(es)
  * @param integer $intAuthorizationLevelId
  * @return AuthorizationLevel
  */
 public static function LoadByAuthorizationLevelId($intAuthorizationLevelId, $objOptionalClauses = null)
 {
     return AuthorizationLevel::QuerySingle(QQ::Equal(QQN::AuthorizationLevel()->AuthorizationLevelId, $intAuthorizationLevelId), $objOptionalClauses);
 }