예제 #1
0
파일: payment.php 프로젝트: alcf/chms
 public function lstQuantity_Change($strFormId, $strControlId, $strParameter)
 {
     $lstQuantity = $this->GetControl($strControlId);
     $objFormProduct = FormProduct::Load($strParameter);
     $objSignupProduct = SignupProduct::LoadBySignupEntryIdFormProductId($this->objSignupEntry->Id, $objFormProduct->Id);
     if (!$objSignupProduct) {
         if ($lstQuantity->SelectedValue) {
             $this->objSignupEntry->AddProduct($objFormProduct, $lstQuantity->SelectedValue);
         }
     } else {
         if ($lstQuantity->SelectedValue) {
             $objSignupProduct->Quantity = $lstQuantity->SelectedValue;
             $objSignupProduct->Save();
         } else {
             $objSignupProduct->Delete();
         }
         $this->objSignupEntry->RefreshAmounts();
     }
     $this->RefreshForm();
 }