/**
  * Function addeditAction for add and edit the user's information.
  */
 public function addeditAction()
 {
     $asUser = Zend_Json_Decoder::decode($this->getRequest()->getParam('ssUserDetail'), Zend_Json::TYPE_ARRAY);
     if ($asUser['id_user'] == 0) {
         $oUser = new Model_Users();
         $oUser->saveUser($asUser);
     } else {
         $oUser = Model_UsersTable::updateUser($asUser);
     }
     $asResponse = array('status' => 'success', 'massage' => 'Record added or edited successfully');
     echo Zend_Json_Encoder::encode($asResponse);
     exit;
 }
 /**
  * Function addeditAction for add and edit the user's information.
  */
 public function addeditAction()
 {
     $oForm = new Application_Form_AddUsers();
     $oForm->submit->setLabel('Save');
     if ($this->getRequest()->getParam('id') != '' && is_numeric($this->getRequest()->getParam('id'))) {
         unset($oForm->password);
     }
     if ($this->getRequest()->isPost()) {
         if ($oForm->isValid($this->getRequest()->getPost())) {
             if ($this->getRequest()->getParam('id_user') > 0) {
                 $oUser = Model_UsersTable::updateUser($oForm->getValues());
             } else {
                 $oUser = new Model_Users();
                 $oUser->saveUser($oForm->getValues());
             }
             $this->_redirect('/user/list');
         }
     } elseif ($this->getRequest()->getParam('id') != '') {
         $oUser = Model_UsersTable::findUser($this->getRequest()->getParam('id'));
         $oForm->populate($oUser[0]);
     }
     $this->view->snIdUser = $this->getRequest()->getParam('id') ? $this->getRequest()->getParam('id') : '';
     $this->view->form = $oForm;
 }
 /**
  * For update user in user table
  * When user array  is provided
  * @author Rashmi Upadhyay
  * @access public 
  */
 public function testUpdateUserSuccessfully()
 {
     Model_UsersTable::updateUser($this->updateuser);
     $this->assertTrue(true, "Record update successfully");
 }