public function RenderRole(HouseholdParticipation $objParticipation) { $strControlId = 'txtRole' . $objParticipation->Id; if (!($txtRole = $this->GetControl($strControlId))) { $txtRole = new QTextBox($this->dtgMembers, $strControlId); $txtRole->Text = $objParticipation->RoleOverride; } $strControlId = 'lblRole' . $objParticipation->Id; if (!($lblRole = $this->GetControl($strControlId))) { $lblRole = new QLabel($this->dtgMembers, $strControlId); $lblRole->Text = 'Head'; } if ($this->objHousehold->HeadPersonId == $objParticipation->PersonId) { $txtRole->Text = null; $txtRole->Visible = false; $lblRole->Visible = true; } else { $txtRole->Visible = true; $lblRole->Visible = false; } return $lblRole->Render(false) . $txtRole->Render(false); }
public function dtgRole_RoleNameColumn_Render(NarroRole $objNarroRole) { $strControlId = 'lblRoleName' . $objNarroRole->RoleId; $lblRoleName = $this->Form->GetControl($strControlId); if (!$lblRoleName) { $lblRoleName = new QLabel($this->dtgRole, $strControlId); $lblRoleName->DisplayStyle = QDisplayStyle::Inline; $lblRoleName->Text = t($objNarroRole->RoleName); } $strControlId = 'txtEditRole' . $objNarroRole->RoleId; $txtEditRole = $this->Form->GetControl($strControlId); if (!$txtEditRole) { $txtEditRole = new QTextBox($this->dtgRole, $strControlId); $txtEditRole->DisplayStyle = QDisplayStyle::None; $txtEditRole->Text = $objNarroRole->RoleName; } return $lblRoleName->Render(false) . $txtEditRole->Render(false); }