public function selectAddRacquet($sender, $param)
 {
     $this->racquetSelect = TblRacquets::finder()->findBy_id($param->Item->IDColumnRacquet->Text);
     $this->setViewState('racquetSelect', $this->racquetSelect);
     //var_dump($this->getViewState('userSelect',null));
     //var_dump($this->getViewState('racquetSelect',null));
     $this->editable->Visible = true;
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['description'] = 'asc';
     $brands = TblBrands::finder()->findAll($criteria);
     $this->DDLBrands->DataSource = $brands;
     $this->DDLBrands->dataBind();
     $this->DDLBrands->SelectedValue = $this->racquetSelect->tbl_brands_id;
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['description'] = 'asc';
     $patterns = TblRacquetsPattern::finder()->findAll($criteria);
     $this->DDLPatterns->DataSource = $patterns;
     $this->DDLPatterns->dataBind();
     $this->DDLPatterns->SelectedValue = $this->racquetSelect->tbl_racquets_pattern_id;
     $this->Model->Text = $this->racquetSelect->model;
     $this->HeadSize->Text = $this->racquetSelect->head_size;
     $this->Length->Text = $this->racquetSelect->length;
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['europe_size'] = 'asc';
     $gripSize = TblGripSize::finder()->findAll($criteria);
     $gripSizeArray = array();
     foreach ($gripSize as $row) {
         $gripSizeArray[$row->id] = $row->europe_size . " (" . $row->usa_size . ")";
     }
     $this->DDLGripSize->DataSource = $gripSizeArray;
     $this->DDLGripSize->dataBind();
     $this->Serial->Text = "";
     $this->WeightUnstrung->Text = $this->racquetSelect->weight_unstrung;
     $this->WeightStrung->Text = $this->racquetSelect->weight_strung;
     $this->Balance->Text = $this->racquetSelect->balance;
     $this->Swingweight->Text = $this->racquetSelect->swingweight;
     $this->Stiffness->Text = $this->racquetSelect->stiffness;
     $this->BeamWidth->Text = $this->racquetSelect->beam_width;
     $this->DateBuy->setTimeStamp(strtotime("now"));
     $this->Note->Text = $this->racquetSelect->note;
     $this->setViewState('userRacquetSelect', null);
 }
Example #2
0
 public function Clona($sender, $param)
 {
     $item = $param->Item;
     $this->setViewState('racquet', null);
     $this->DataGridRacquets->SelectedItemIndex = -1;
     $this->editable->Visible = true;
     $this->TypeEdit->Text = Prado::localize('Insert new racquet');
     $racquetClone = TblRacquets::finder()->findBy_id($param->Item->IDColumn->Text);
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['description'] = 'asc';
     $brands = TblBrands::finder()->findAll($criteria);
     $this->DDLBrands->DataSource = $brands;
     $this->DDLBrands->dataBind();
     $this->DDLBrands->SelectedValue = $racquetClone->tbl_brands_id;
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['description'] = 'asc';
     $patterns = TblRacquetsPattern::finder()->findAll($criteria);
     $this->DDLPatterns->DataSource = $patterns;
     $this->DDLPatterns->dataBind();
     $this->DDLPatterns->SelectedValue = $racquetClone->tbl_racquets_pattern_id;
     $this->Model->Text = $racquetClone->model;
     $this->HeadSize->Text = $racquetClone->head_size;
     $this->Length->Text = $racquetClone->length;
     $this->WeightUnstrung->Text = $racquetClone->weight_unstrung;
     $this->WeightStrung->Text = $racquetClone->weight_strung;
     $this->Balance->Text = $racquetClone->balance;
     $this->Swingweight->Text = $racquetClone->swingweight;
     $this->Stiffness->Text = $racquetClone->stiffness;
     $this->BeamWidth->Text = $racquetClone->beam_width;
     $this->Note->Text = $racquetClone->note;
 }