public function getEmployeeListAsJson() { $companyService = new CompanyService(); return $companyService->getEmployeeListAsJson(); }
/** * Update User Group * @param sfWebRequest $request * @return unknown_type */ public function executeUpdateUser(sfWebRequest $request) { $companyService = new CompanyService(); $userService = new UserService(); $user = $userService->readUser($request->getParameter('id')); $this->user = $user; if ($request->isMethod('post')) { $user->setIsAdmin($request->getParameter('isAdmin')); $user->setUserName($request->getParameter('txtUserName')); $user->setUserPassword($request->getParameter('txtUserPassword')); $user->setUsergId($request->getParameter('cmbUserGroupID')); $user->setStatus($request->getParameter('cmbUserStatus')); $user->setEmpNumber($request->getParameter('txtEmpId')); $userService->saveUser($user); $this->setMessage('SUCCESS', array(TopLevelMessages::SAVE_SUCCESS)); $this->redirect('admin/listUser?isAdmin=' . $request->getParameter('isAdmin')); } $this->userType = $request->getParameter('isAdmin'); $this->listUserGroup = $userService->getUserGroupList(); $this->empJson = $companyService->getEmployeeListAsJson(); }