private function getInitialValue($idta_feldfunktion, $idtm_stammdaten, $monat, $idta_variante, &$StartValue)
 {
     //First we check for the single month::
     $Results = TTStammdatenRecord::finder()->find('idtm_stammdaten = ? AND idta_periode = ? AND idta_variante = ? AND idta_feldfunktion = ?', $idtm_stammdaten, PeriodenRecord::finder()->findByper_Intern($monat)->idta_perioden, $idta_variante, $idta_feldfunktion);
     if (count($Results) == 1) {
         $StartValue = $Results->tt_stammdaten_value;
     } else {
         $Result = TTStammdatenRecord::finder()->find('idtm_stammdaten = ? AND idta_periode = ? AND idta_variante = ? AND idta_feldfunktion = ?', $idtm_stammdaten, PeriodenRecord::finder()->findByper_Intern($this->getYearByMonth($monat))->idta_perioden, $idta_variante, $idta_feldfunktion);
         if (count($Result) == 1) {
             $StartValue = $Result->tt_stammdaten_value;
         }
     }
 }
 public function RCDeleteButtonClicked($sender, $param)
 {
     $tempus = 'RCed' . $this->RCprimarykey;
     if ($this->RCedstammdaten_group_edit_status->Text == '1') {
         StammdatenRecord::finder()->deleteByidta_stammdaten_group($this->{$tempus}->Text);
         $StammdatenRecord = StammdatenRecord::finder()->findAllByidta_stammdaten_group($this->{$tempus}->Text);
         if (count($StammdatenRecord) >= 1) {
             foreach ($StammdatenRecord as $StammRecord) {
                 $TTStammdatenRecords = TTStammdatenRecord::finder()->findAllByidtm_stammdaten($StammRecord->idtm_stammdaten);
                 foreach ($TTStammdatenRecords as $TTStammdatenRecord) {
                     TTStammdatenRecord::finder()->delteByidtm_stammdaten($TTStammdatenRecord->idtt_stammdaten);
                 }
                 TTStammdatenStammdatenRecord::finder()->deleteByidtm_stammdaten_group($StammRecord->idtm_stammdaten);
             }
         }
         $RCEditRecord = StammdatenGroupRecord::finder()->findByPK($this->{$tempus}->Text);
         $RCEditRecord->delete();
     }
     $this->buildStammdatenGroupPullDown();
     $this->bindListStammdatenGroupValue();
 }
 public function RCTSavedButtonClicked($sender, $param)
 {
     $tempus = 'RCTed' . $this->RCTprimarykey;
     if ($this->RCTedttstammdaten_edit_status->Text == '1') {
         $RCTEditRecord = TTStammdatenRecord::finder()->findByPK($this->{$tempus}->Text);
     } else {
         $RCTEditRecord = new TTStammdatenRecord();
     }
     //HIDDEN
     foreach ($this->RCThiddenfields as $recordfield) {
         $edrecordfield = 'RCTed' . $recordfield;
         $RCTEditRecord->{$recordfield} = $this->{$edrecordfield}->Value;
     }
     //DATUM
     foreach ($this->RCTdatfields as $recordfield) {
         $edrecordfield = 'RCTed' . $recordfield;
         $RCTEditRecord->{$recordfield} = date('Y-m-d', $this->{$edrecordfield}->TimeStamp);
     }
     //BOOL
     foreach ($this->RCTboolfields as $recordfield) {
         $edrecordfield = 'RCTed' . $recordfield;
         $RCTEditRecord->{$recordfield} = $this->{$edrecordfield}->Checked ? 1 : 0;
     }
     foreach ($this->RCTfields as $recordfield) {
         $edrecordfield = 'RCTed' . $recordfield;
         $RCTEditRecord->{$recordfield} = $this->{$edrecordfield}->Text;
     }
     $RCTEditRecord->idtm_stammdaten = $this->RCedidtm_stammdaten->Text;
     $RCTEditRecord->save();
     $this->bindListTTStammdatenValue();
 }