Beispiel #1
0
 protected function Redirect()
 {
     $objVariable = ClassVariable::Load(QApplication::PathInfo(0));
     if ($objVariable) {
         QApplication::Redirect('/index.php/' . $this->objVariable->QcodoClass->Name . '/Variables');
     } else {
         QApplication::Redirect('/index.php');
     }
 }
 protected function SetupClassVariable()
 {
     // Lookup Object PK information from Query String (if applicable)
     // Set mode to Edit or New depending on what's found
     $intId = QApplication::QueryString('intId');
     if ($intId) {
         $this->objClassVariable = ClassVariable::Load($intId);
         if (!$this->objClassVariable) {
             throw new Exception('Could not find a ClassVariable object with PK arguments: ' . $intId);
         }
         $this->strTitleVerb = QApplication::Translate('Edit');
         $this->blnEditMode = true;
     } else {
         $this->objClassVariable = new ClassVariable();
         $this->strTitleVerb = QApplication::Translate('Create');
         $this->blnEditMode = false;
     }
 }
 protected function UpdateVariableFields()
 {
     $this->objVariable->Name = $this->txtName->Text;
     $this->objVariable->VariableTypeId = $this->lstVariableType->SelectedValue;
     $this->objVariable->ObjectTypeId = $this->lstObjectType->SelectedValue;
     $this->objVariable->ArrayFlag = $this->chkArrayFlag->Checked;
     $this->objVariable->DefaultValue = $this->txtDefaultValue->Text;
     $this->objVariable->FirstVersion = $this->txtFirstVersion->Text;
     $this->objVariable->LastVersion = $this->txtLastVersion->Text;
     $this->objVariable->ShortDescription = $this->txtShortDescription->Text;
     $this->objVariable->ExtendedDescription = $this->txtExtendedDescription->Text;
     $this->objVariable->ClassProperty = ClassProperty::Load($this->lstClassProperty->SelectedValue);
     $this->objVariable->ClassVariable = ClassVariable::Load($this->lstClassVariable->SelectedValue);
     $this->objVariable->Parameter = Parameter::Load($this->lstParameter->SelectedValue);
     $this->objVariable->QcodoConstant = QcodoConstant::Load($this->lstQcodoConstant->SelectedValue);
 }
Beispiel #4
0
 protected function btnSave_Click($strFormId, $strControlId, $strParameter)
 {
     if ($this->lstClassVariable->SelectedValue) {
         $objClassVariable = ClassVariable::Load($this->lstClassVariable->SelectedValue);
         // Update Property
         $this->objProperty->ClassVariable = $objClassVariable;
         $this->objProperty->VariableGroupId = $objClassVariable->VariableGroupId;
         $this->objProperty->Save();
         // Have Variable matche ClassVariable's Variable
         $this->objProperty->Variable->VariableTypeId = $objClassVariable->Variable->VariableTypeId;
         $this->objProperty->Variable->ObjectTypeId = $objClassVariable->Variable->ObjectTypeId;
         $this->objProperty->Variable->ArrayFlag = $objClassVariable->Variable->ArrayFlag;
         $this->objProperty->Variable->DefaultValue = $objClassVariable->Variable->DefaultValue;
         $this->objProperty->Variable->ShortDescription = $objClassVariable->Variable->ShortDescription;
         $this->objProperty->Variable->ExtendedDescription = $objClassVariable->Variable->ExtendedDescription;
         $this->objProperty->Variable->Save();
     } else {
         $this->objProperty->ClassVariable = null;
         $this->objProperty->VariableGroupId = $this->lstVariableGroup->SelectedValue;
         $this->objProperty->Save();
         $objVariable = $this->ctlVariable->Variable;
         $objVariable->Save();
     }
     $this->Redirect();
 }
 /**
  * Override method to perform a property "Get"
  * This will get the value of $strName
  *
  * @param string $strName Name of the property to get
  * @return mixed
  */
 public function __get($strName)
 {
     switch ($strName) {
         ///////////////////
         // Member Variables
         ///////////////////
         case 'Id':
             /**
              * Gets the value for intId (Read-Only PK)
              * @return integer
              */
             return $this->intId;
         case 'QcodoClassId':
             /**
              * Gets the value for intQcodoClassId (Not Null)
              * @return integer
              */
             return $this->intQcodoClassId;
         case 'VariableGroupId':
             /**
              * Gets the value for intVariableGroupId 
              * @return integer
              */
             return $this->intVariableGroupId;
         case 'VariableId':
             /**
              * Gets the value for intVariableId (Unique)
              * @return integer
              */
             return $this->intVariableId;
         case 'ClassVariableId':
             /**
              * Gets the value for intClassVariableId 
              * @return integer
              */
             return $this->intClassVariableId;
         case 'ReadOnlyFlag':
             /**
              * Gets the value for blnReadOnlyFlag 
              * @return boolean
              */
             return $this->blnReadOnlyFlag;
         case 'WriteOnlyFlag':
             /**
              * Gets the value for blnWriteOnlyFlag 
              * @return boolean
              */
             return $this->blnWriteOnlyFlag;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'QcodoClass':
             /**
              * Gets the value for the QcodoClass object referenced by intQcodoClassId (Not Null)
              * @return QcodoClass
              */
             try {
                 if (!$this->objQcodoClass && !is_null($this->intQcodoClassId)) {
                     $this->objQcodoClass = QcodoClass::Load($this->intQcodoClassId);
                 }
                 return $this->objQcodoClass;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'VariableGroup':
             /**
              * Gets the value for the VariableGroup object referenced by intVariableGroupId 
              * @return VariableGroup
              */
             try {
                 if (!$this->objVariableGroup && !is_null($this->intVariableGroupId)) {
                     $this->objVariableGroup = VariableGroup::Load($this->intVariableGroupId);
                 }
                 return $this->objVariableGroup;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Variable':
             /**
              * Gets the value for the Variable object referenced by intVariableId (Unique)
              * @return Variable
              */
             try {
                 if (!$this->objVariable && !is_null($this->intVariableId)) {
                     $this->objVariable = Variable::Load($this->intVariableId);
                 }
                 return $this->objVariable;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ClassVariable':
             /**
              * Gets the value for the ClassVariable object referenced by intClassVariableId 
              * @return ClassVariable
              */
             try {
                 if (!$this->objClassVariable && !is_null($this->intClassVariableId)) {
                     $this->objClassVariable = ClassVariable::Load($this->intClassVariableId);
                 }
                 return $this->objClassVariable;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             ////////////////////////////
             // Virtual Object References (Many to Many and Reverse References)
             // (If restored via a "Many-to" expansion)
             ////////////////////////////
         ////////////////////////////
         // Virtual Object References (Many to Many and Reverse References)
         // (If restored via a "Many-to" expansion)
         ////////////////////////////
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
 public function btnEdit_Click($strFormId, $strControlId, $strParameter)
 {
     $strParameterArray = explode(',', $strParameter);
     $objClassVariable = ClassVariable::Load($strParameterArray[0]);
     $objEditPanel = new ClassVariableEditPanel($this, $this->strCloseEditPanelMethod, $objClassVariable);
     $strMethodName = $this->strSetEditPanelMethod;
     $this->objForm->{$strMethodName}($objEditPanel);
 }