/** * Delete Company property * * @param sfWebRequest $request * @return unknown_type */ public function executeProcessCompnayProperty(sfWebRequest $request) { if ($request->isMethod('post')) { $mode = $request->getParameter('mode'); switch ($mode) { case 'delete': if (count($request->getParameter('chkLocID')) > 0) { $companyService = new CompanyService(); $companyService->deleteCompanyProperty($request->getParameter('chkLocID')); $this->setMessage('SUCCESS', array(TopLevelMessages::DELETE_SUCCESS)); } else { $this->setMessage('NOTICE', array(TopLevelMessages::SELECT_RECORDS)); } break; case 'save': $companyService = new CompanyService(); foreach ($request->getParameter('txtProperty') as $id => $value) { $comProperty = $companyService->readCompanyProperty($id); $comProperty->setEmpId($value); $companyService->saveCompanyProporty($comProperty); } $this->setMessage('SUCCESS', array(TopLevelMessages::UPDATE_SUCCESS)); break; } } $this->redirect('admin/listCompanyProporty'); }