Пример #1
0
 protected function Form_Create()
 {
     $this->objGroupRegistration = new GroupRegistrations();
     $this->mcGroupRegistration = new GroupRegistrationsMetaControl($this, $this->objGroupRegistration);
     $this->txtFirstName = $this->mcGroupRegistration->txtFirstName_Create();
     $this->txtFirstName->Select();
     $this->txtFirstName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtFirstName->Required = true;
     $this->txtLastName = $this->mcGroupRegistration->txtLastName_Create();
     $this->txtLastName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtLastName->Required = true;
     $this->lstGender = new QListBox($this);
     $this->lstGender->Name = 'Gender';
     $this->lstGender->AddItem('- Select One -');
     $this->lstGender->AddItem('Female', 'F');
     $this->lstGender->AddItem('Male', 'M');
     $this->txtAddress = $this->mcGroupRegistration->txtAddress_Create();
     $this->txtAddress->Name = 'Address';
     $this->txtAddress->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtAddress->Required = true;
     $this->txtCity = $this->mcGroupRegistration->txtCity_Create();
     $this->txtCity->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtCity->Required = true;
     $this->txtZipCode = $this->mcGroupRegistration->txtZipcode_Create();
     $this->txtZipCode->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtZipCode->Required = true;
     $this->txtPhoneNumber = $this->mcGroupRegistration->txtPhone_Create();
     $this->txtPhoneNumber->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtPhoneNumber->Required = true;
     $this->txtEmail = $this->mcGroupRegistration->txtEmail_Create();
     $this->txtEmail->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtEmail->Required = true;
     $this->txtComments = $this->mcGroupRegistration->txtComments_Create();
     $this->txtComments->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->lstSource = new QListBox($this);
     $this->lstSource->Name = 'How did you hear about us? ';
     $this->lstSource->Width = 250;
     $this->lstSource->AddItem('Choose...', 0);
     foreach (SourceList::LoadAll() as $objSourceList) {
         $this->lstSource->AddItem($objSourceList->Name, $objSourceList->Id);
     }
     $this->lstParticipationType = new QListBox($this);
     $this->lstParticipationType->Name = 'What would you like to be?';
     $objRoleArray = Ministry::Load(17)->GetGroupRoleArray(QQ::OrderBy(QQN::GroupRole()->Name));
     $this->lstParticipationType->AddItem('-Select One-');
     foreach ($objRoleArray as $objRole) {
         $this->lstParticipationType->AddItem($objRole->Name, $objRole->Id);
     }
     $this->lstParticipationType->AddAction(new QChangeEvent(), new QAjaxAction('lstParticipationType_Change'));
     $this->lblMessage = new QLabel($this);
     $this->lblMessage->Text = '';
     $this->lblMessage->ForeColor = 'red';
     $this->lblMessage->HtmlEntities = false;
     $this->chkDaysAvailable = array();
     foreach (GrowthGroupDayType::$NameArray as $key => $value) {
         $objChkDay = new QCheckBox($this);
         $objChkDay->Text = $value;
         $objChkDay->Name = $key;
         $this->chkDaysAvailable[] = $objChkDay;
     }
     $this->chkGroupType = array();
     $objCondition = QQ::All();
     $objGrowthGroupStructureCursor = GrowthGroupStructure::QueryCursor($objCondition);
     while ($objGrowthGroupStructure = GrowthGroupStructure::InstantiateCursor($objGrowthGroupStructureCursor)) {
         $objListItem = new QCheckBox($this);
         $objListItem->Text = $objGrowthGroupStructure->__toString();
         $objListItem->Name = $objGrowthGroupStructure->Id;
         $this->chkGroupType[] = $objListItem;
     }
     $this->lstLocationFirst = new QListBox($this);
     $this->lstLocationFirst->Name = 'First Preference';
     $this->lstLocationFirst->AddItem('Belmont');
     $this->lstLocationFirst->AddItem('East Palo Alto');
     $this->lstLocationFirst->AddItem('Fremont');
     $this->lstLocationFirst->AddItem('Los Altos');
     $this->lstLocationFirst->AddItem('Milpitas');
     $this->lstLocationFirst->AddItem('Mountain View');
     $this->lstLocationFirst->AddItem('Newark ');
     $this->lstLocationFirst->AddItem('Oakland');
     $this->lstLocationFirst->AddItem('Palo Alto');
     $this->lstLocationFirst->AddItem('San Francisco');
     $this->lstLocationFirst->AddItem('San Jose');
     $this->lstLocationFirst->AddItem('Santa Clara');
     $this->lstLocationFirst->AddItem('South San Jose');
     $this->lstLocationFirst->AddItem('Sunnyvale');
     $this->lstLocationSecond = new QListBox($this);
     $this->lstLocationSecond->Name = 'Second Preference';
     $this->lstLocationSecond->AddItem('Belmont');
     $this->lstLocationSecond->AddItem('East Palo Alto');
     $this->lstLocationSecond->AddItem('Fremont');
     $this->lstLocationSecond->AddItem('Los Altos');
     $this->lstLocationSecond->AddItem('Milpitas');
     $this->lstLocationSecond->AddItem('Mountain View');
     $this->lstLocationSecond->AddItem('Newark ');
     $this->lstLocationSecond->AddItem('Oakland');
     $this->lstLocationSecond->AddItem('Palo Alto');
     $this->lstLocationSecond->AddItem('San Francisco');
     $this->lstLocationSecond->AddItem('San Jose');
     $this->lstLocationSecond->AddItem('Santa Clara');
     $this->lstLocationSecond->AddItem('South San Jose');
     $this->lstLocationSecond->AddItem('Sunnyvale');
     $this->btnSubmit = new QButton($this);
     $this->btnSubmit->Name = 'Submit';
     $this->btnSubmit->Text = 'Submit';
     $this->btnSubmit->CssClass = 'primary';
     $this->btnSubmit->AddAction(new QClickEvent(), new QAjaxAction('btnSubmit_Click'));
     $this->btnSubmit->CausesValidation = true;
     $this->btnCancel = new QButton($this);
     $this->btnCancel->Name = 'Cancel';
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->CssClass = 'primary';
 }
 /**
  * Create and setup QListBox lstGrowthGroupStructuresAsGroupstructure
  * @param string $strControlId optional ControlId to use
  * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself
  * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query
  * @return QListBox
  */
 public function lstGrowthGroupStructuresAsGroupstructure_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null)
 {
     $this->lstGrowthGroupStructuresAsGroupstructure = new QListBox($this->objParentObject, $strControlId);
     $this->lstGrowthGroupStructuresAsGroupstructure->Name = QApplication::Translate('Growth Group Structures As Groupstructure');
     $this->lstGrowthGroupStructuresAsGroupstructure->SelectionMode = QSelectionMode::Multiple;
     // We need to know which items to "Pre-Select"
     $objAssociatedArray = $this->objGroupRegistrations->GetGrowthGroupStructureAsGroupstructureArray();
     // Setup and perform the Query
     if (is_null($objCondition)) {
         $objCondition = QQ::All();
     }
     $objGrowthGroupStructureCursor = GrowthGroupStructure::QueryCursor($objCondition, $objOptionalClauses);
     // Iterate through the Cursor
     while ($objGrowthGroupStructure = GrowthGroupStructure::InstantiateCursor($objGrowthGroupStructureCursor)) {
         $objListItem = new QListItem($objGrowthGroupStructure->__toString(), $objGrowthGroupStructure->Id);
         foreach ($objAssociatedArray as $objAssociated) {
             if ($objAssociated->Id == $objGrowthGroupStructure->Id) {
                 $objListItem->Selected = true;
             }
         }
         $this->lstGrowthGroupStructuresAsGroupstructure->AddItem($objListItem);
     }
     // Return the QListControl
     return $this->lstGrowthGroupStructuresAsGroupstructure;
 }