protected function modListener_EditSweepstake_saveSweepstake($userRequest)
 {
     if (FrameworkUserManager::getCurrentUserRole() == FrameworkUserManager::$ROLE_VIEWER) {
         $this->model->setNotPermitted();
     } else {
         $data = array();
         $data["title"] = $userRequest->getHttpRequestParam("title");
         $data["desc"] = $userRequest->getHttpRequestParam("desc");
         $data["restriction_text"] = $userRequest->getHttpRequestParam("restriction_text");
         $data["start_date"] = $userRequest->getHttpRequestParam("start_date");
         $data["end_date"] = $userRequest->getHttpRequestParam("end_date");
         $data["enter_once_type"] = $userRequest->getHttpRequestParam("enter_once_type");
         $data["bonus_point"] = $userRequest->getHttpRequestParam("bonus_point");
         $data["bonus_enter_type"] = $userRequest->getHttpRequestParam("bonus_enter_type");
         $data["publish_enter"] = $userRequest->getHttpRequestParam("publish_enter");
         $data["min_age"] = $userRequest->getHttpRequestParam("min_age");
         $data["create_date"] = time();
         if ($userRequest->getHttpRequestParam("sweepstakeId") / 1 < 0) {
             $id = $this->model->create($data);
             $userRequest->changeHttpRequestParam(array(FrameworkRequest::$REQUEST_PARAM__actionId => "editSweepstake", "sweepstakeId" => $id));
         } else {
             $this->model->edit($userRequest->getHttpRequestParam("sweepstakeId"), $data);
         }
     }
 }
 protected function modListener_WinnersList_emailWinners($userRequest)
 {
     if (FrameworkUserManager::getCurrentUserRole() == FrameworkUserManager::$ROLE_VIEWER) {
         $this->model->setNotPermitted();
     } else {
         $this->model->emailWinner($userRequest->getHttpRequestParam("sweepstakeId"), $userRequest->getHttpRequestParam("userId"));
     }
 }
 protected function modListener_SweepstakeList_removeSweepstake($userRequest)
 {
     if (FrameworkUserManager::getCurrentUserRole() == FrameworkUserManager::$ROLE_VIEWER) {
         $this->model->setNotPermitted();
     } else {
         $this->model->remove($userRequest->getHttpRequestParam("sweepstakeId"));
     }
 }
 protected function modListener_EditShare_save($userRequest)
 {
     if (FrameworkUserManager::getCurrentUserRole() == FrameworkUserManager::$ROLE_VIEWER) {
         $this->model->setNotPermitted();
     } else {
         $data = $this->getDataFromRequest($userRequest, $this->model);
         $this->model->edit($userRequest->getHttpRequestParam("sweepstakeId"), $data);
     }
 }
 protected function modListener_EditMessage_saveMessage($userRequest)
 {
     if (FrameworkUserManager::getCurrentUserRole() == FrameworkUserManager::$ROLE_VIEWER) {
         $this->model->setNotPermitted();
     } else {
         $data = array();
         $data["before_start_message"] = $userRequest->getHttpRequestParam("before_start_message");
         $data["after_end_message"] = $userRequest->getHttpRequestParam("after_end_message");
         $data["welcome_message"] = $userRequest->getHttpRequestParam("welcome_message");
         $data["winner_message"] = $userRequest->getHttpRequestParam("winner_message");
         $this->model->edit($userRequest->getHttpRequestParam("sweepstakeId"), $data);
     }
 }