Exemplo n.º 1
0
	public function ajaxaddAction()
	{
		$this->_helper->layout()->disableLayout();
		$this->_helper->viewRenderer->setNoRender(true);
		$materials = new Pment_Models_MaterialMapper();
		$material = new Pment_Models_Material();
		$material->setPlanId($this->_getParam('planId'));
		$material->setType($this->_getParam('type'));
		$material->setMName($this->_getParam('mName'));
		$material->setSpec($this->_getParam('spec'));
		$material->setUnit($this->_getParam('unit'));
		$material->setAmount(0);
		$material->setAmountc($this->_getParam('amountc'));
		$material->setBudget($this->_getParam('budget'));
		$material->setBudgetTotal($this->_getParam('budgetTotal'));
		$material->setInDate($this->_getParam('inDate'));
		$material->setRemark($this->_getParam('remark'));
		$material->setAmountf($this->_getParam('amountf'));
		$material->setCost($this->_getParam('cost'));
		$material->setCostTotal($this->_getParam('costTotal'));
		$material->setVendorName($this->_getParam('vendorName'));
		$id = $materials->save($material);
		echo $id;
	}
Exemplo n.º 2
0
	public function fetchAllJoin($key = null,$condition = null) 
	{
		if($condition == null)
		{
			$resultSet = $this->getDbTable()->fetchAll();
			}
			else
			{
				$resultSet = $this->getDbTable()->search($key,$condition);
				}
		
		$entries = array();
		
		foreach($resultSet as $row){
			$entry = new Pment_Models_Material();
			$entry->setMtrId($row->mtrId)
				->setPlanId($row->planId)
				->setType($row->type)
				->setMName($row->mName)
				->setUnit($row->unit)
				->setSpec($row->spec)
				->setAmount($row->amount)
				->setInDate($row->inDate)
				->setAmountc($row->amountc)
				->setAmountf($row->amountf)
				->setCost($row->cost)
				->setCostTotal($row->costTotal)
				->setBudget($row->budget)
				->setBudgetTotal($row->budgetTotal)
				->setRemark($row->remark)
				->setVendorName($row->vendorName);
			$entries[] = $entry;
			}
		return $entries;
		}