コード例 #1
0
 public function addMake()
 {
     $ccm_makes = new CcmMakes();
     $ccm_makes->setTransactionReference($this->form_values['transaction_reference']);
     $ccm_makes->setTransactionNumber($trans_no);
     $created_by = $this->_em->find('Users', $this->_user_id);
     $ccm_makes->setCreatedBy($created_by);
     $ccm_makes->setCreatedDate(App_Tools_Time::now());
     $ccm_makes->setModifiedBy($created_by);
     $ccm_makes->setModifiedDate(App_Tools_Time::now());
     $this->_em->persist($ccm_makes);
     $this->_em->flush();
     return $stock_master->getPkId();
 }
コード例 #2
0
 public function addAction()
 {
     $form = new Form_Cadmin_MakeAdd();
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             $makes = new CcmMakes();
             $makes->setCcmMakeName($form->ccm_make_name->getValue());
             $makes->setStatus($form->status->getValue());
             $created_by = $this->_em->find('Users', $this->_userid);
             $makes->setCreatedBy($created_by);
             $makes->setCreatedDate(new \DateTime());
             $makes->setModifiedBy($created_by);
             $makes->setModifiedDate(new \DateTime());
             $this->_em->persist($makes);
             $this->_em->flush();
         }
     }
     $this->_redirect("/cadmin/manage-makes");
 }
コード例 #3
0
 public function setModifiedDate($modifiedDate)
 {
     $this->__load();
     return parent::setModifiedDate($modifiedDate);
 }
コード例 #4
0
 public function addNewMakeModel()
 {
     //  $this->form_values['ccm_make_popup'];
     $created_by = $this->_em->getRepository('Users')->find($this->_user_id);
     $ccm_make = new CcmMakes();
     $ccm_make->setCcmMakeName($this->form_values['ccm_make_popup']);
     $ccm_make->setCreatedBy($created_by);
     $ccm_make->setModifiedBy($created_by);
     $ccm_make->setCreatedDate(new \DateTime(date("Y-m-d")));
     $ccm_make->setModifiedDate(new \DateTime(date("Y-m-d")));
     $this->_em->persist($ccm_make);
     $this->_em->flush();
     $ccm_make_i = $ccm_make->getPkId();
     $ccm_model = new CcmModels();
     $ccm_voltage_regulator = new CcmVoltageRegulators();
     $ccm_make_id = $this->_em->getRepository('CcmMakes')->find($ccm_make_i);
     $ccm_model->setCcmMake($ccm_make_id);
     $ccm_model->setCcmModelName($this->form_values['ccm_model_popup']);
     $ccm_model->setCatalogueId($this->form_values['catalogue_id_popup']);
     if (!empty($this->form_values['asset_dimension_height_popup'])) {
         $ccm_model->setAssetDimensionHeight($this->form_values['asset_dimension_height_popup']);
     }
     if (!empty($this->form_values['asset_dimension_length_popup'])) {
         $ccm_model->setAssetDimensionLength($this->form_values['asset_dimension_length_popup']);
     }
     if (!empty($this->form_values['asset_dimension_width_popup'])) {
         $ccm_model->setAssetDimensionWidth($this->form_values['asset_dimension_width_popup']);
     }
     if (!empty($this->form_values['internal_dimension_width_popup'])) {
         $ccm_model->setInternalDimensionWidth($this->form_values['internal_dimension_width_popup']);
     }
     if (!empty($this->form_values['internal_dimension_width_popup'])) {
         $ccm_model->setInternalDimensionWidth($this->form_values['internal_dimension_width_popup']);
     }
     if (!empty($this->form_values['internal_dimension_width_popup'])) {
         $ccm_model->setInternalDimensionWidth($this->form_values['internal_dimension_width_popup']);
     }
     if (!empty($this->form_values['storage_dimension_width_popup'])) {
         $ccm_model->setStorageDimensionWidth($this->form_values['storage_dimension_width_popup']);
     }
     if (!empty($this->form_values['storage_dimension_width_popup'])) {
         $ccm_model->setStorageDimensionWidth($this->form_values['storage_dimension_width_popup']);
     }
     if (!empty($this->form_values['storage_dimension_width_popup'])) {
         $ccm_model->setStorageDimensionWidth($this->form_values['storage_dimension_width_popup']);
     }
     if (!empty($this->form_values['net_capacity_4'])) {
         $ccm_model->setNetCapacity4($this->form_values['net_capacity_4']);
     }
     if (!empty($this->form_values['cold_life'])) {
         $ccm_model->setColdLife($this->form_values['cold_life']);
     }
     if (!empty($this->form_values['ccm_asset_type_id_popup'])) {
         $asset_id_m = $this->_em->getRepository('CcmAssetTypes')->find($this->form_values['ccm_asset_type_id_popup']);
         $ccm_model->setCcmAssetType($asset_id_m);
     }
     if (!empty($this->form_values['cfc_free'])) {
         $ccm_model->setCfcFree($this->form_values['cfc_free']);
     }
     if (!empty($this->form_values['is_pis_pqs'])) {
         $ccm_model->setIsPqs($this->form_values['is_pis_pqs']);
     }
     if (!empty($this->form_values['no_of_phases'])) {
         $ccm_model->setNoOfPhases($this->form_values['no_of_phases']);
     }
     if (!empty($this->form_values['refrigerator_gas_type'])) {
         $refrigerator_gas_type = $this->_em->getRepository('ListDetail')->find($this->form_values['refrigerator_gas_type']);
         $ccm_model->setGasType($refrigerator_gas_type);
     }
     if (!empty($this->form_values['product_price'])) {
         $ccm_model->setProductPrice($this->form_values['product_price']);
     }
     if (!empty($this->form_values['power_source'])) {
         $power_source = $this->_em->getRepository('ListDetail')->find($this->form_values['power_source']);
         $ccm_model->setPowerSource($power_source);
     }
     if (!empty($this->form_values['gross_capacity_4_popup'])) {
         $ccm_model->setGrossCapacity20($this->form_values['gross_capacity_4_popup']);
     }
     if (!empty($this->form_values['gross_capacity_4_popup'])) {
         $ccm_model->setGrossCapacity4($this->form_values['gross_capacity_4_popup']);
     }
     if (!empty($this->form_values['net_capacity_20_popup'])) {
         $ccm_model->setNetCapacity20($this->form_values['net_capacity_20_popup']);
     }
     if (!empty($this->form_values['net_capacity_4_popup'])) {
         $ccm_model->setNetCapacity4($this->form_values['net_capacity_4_popup']);
     }
     if (!empty($this->form_values['nominal_voltage'])) {
         $ccm_voltage_regulator->setNominalVoltage($this->form_values['nominal_voltage']);
     }
     if (!empty($this->form_values['continous_power'])) {
         $ccm_voltage_regulator->setContinousPower($this->form_values['continous_power']);
     }
     if (!empty($this->form_values['frequency'])) {
         $ccm_voltage_regulator->setFrequency($this->form_values['frequency']);
     }
     if (!empty($this->form_values['input_voltage_range'])) {
         $ccm_voltage_regulator->setInputVoltageRange($this->form_values['input_voltage_range']);
     }
     if (!empty($this->form_values['output_voltage_range'])) {
         $ccm_voltage_regulator->setOutputVoltageRange($this->form_values['output_voltage_range']);
     }
     $ccm_model->setStatus(1);
     $ccm_model->setCreatedBy($created_by);
     $ccm_model->setModifiedBy($created_by);
     $ccm_model->setCreatedDate(new \DateTime(date("Y-m-d")));
     $ccm_model->setModifiedDate(new \DateTime(date("Y-m-d")));
     $this->_em->persist($ccm_model);
     $this->_em->flush();
     //$ccm_model_i = $ccm_model->getPkId();
     // return $ccm_model_i;
 }