public function MetaDataBinder()
 {
     $condition = QQ::Equal(QQN::Peopledetails()->Owner, $_SESSION['User']);
     // Remember!  We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     if ($this->Paginator) {
         $this->TotalItemCount = Peopledetails::QueryCount($condition);
     }
     // 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->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be a Query result from Peopledetails, given the clauses above
     //$condition = QQ::Equal(QQN::Peopledetails()->Owner,$_SESSION['User']);
     $this->DataSource = Peopledetails::QueryArray($condition, $objClauses);
     //$this->DataSource = Peopledetails::LoadAll($objClauses);
 }
Exemplo n.º 2
0
 protected function GetPeopleData()
 {
     $objClauses = array();
     array_push($objClauses, QQ::OrderBy(QQN::Peopledetails()->FullName));
     if ($objClause = $this->dtrPeople->LimitClause) {
         array_push($objClauses, $this->dtrPeople->LimitClause);
     }
     if ($this->txtSearchPeople->Text != '') {
         $condition = QQ::OrCondition(QQ::Like(QQN::Peopledetails()->FullName, '%' . $this->txtSearchPeople->Text . '%'), QQ::Like(QQN::Peopledetails()->Email, '%' . $this->txtSearchPeople->Text . '%'), QQ::Like(QQN::Peopledetails()->Phone, '%' . $this->txtSearchPeople->Text . '%'));
         $result = Peopledetails::QueryArray($condition, $objClause);
         $this->dtrPeople->DataSource = $result;
         $this->dtrPeople->TotalItemCount = Peopledetails::QueryCount($condition);
     } else {
         $result = Peopledetails::QueryArray(QQ::All(), $objClause);
         $this->dtrPeople->DataSource = $result;
         $this->dtrPeople->TotalItemCount = Peopledetails::QueryCount(QQ::All());
     }
 }
Exemplo n.º 3
0
 /**
  * Load all Peopledetailses
  * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
  * @return Peopledetails[]
  */
 public static function LoadAll($objOptionalClauses = null)
 {
     if (func_num_args() > 1) {
         throw new QCallerException("LoadAll must be called with an array of optional clauses as a single argument");
     }
     // Call Peopledetails::QueryArray to perform the LoadAll query
     try {
         return Peopledetails::QueryArray(QQ::All(), $objOptionalClauses);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
 }
Exemplo n.º 4
0
 public static function GetContacts($strKeyword = null)
 {
     if (!is_null($strKeyword)) {
         $condition = QQ::AndCondition(QQ::OrCondition(QQ::Like(QQN::Peopledetails()->FullName, '%' . $strKeyword . '%'), QQ::Like(QQN::Peopledetails()->Email, '%' . $strKeyword . '%'), QQ::Like(QQN::Peopledetails()->Address, '%' . $strKeyword . '%'), QQ::Like(QQN::Peopledetails()->Phone, '%' . $strKeyword . '%')), QQ::Equal(QQN::Peopledetails()->Owner, $_SESSION['User']));
         $objPeopleArray = Peopledetails::QueryArray($condition);
         return $objPeopleArray;
     } else {
         $condition = QQ::Equal(QQN::Peopledetails()->Owner, $_SESSION['User']);
         $objPeopleArray = Peopledetails::QueryArray($condition);
         return $objPeopleArray;
     }
 }