Example #1
0
 /**
  * 更新一条公告信息
  * 
  * @param object PwAnnounceDm
  * @return boolean
  */
 public function updateAnnounce(PwAnnounceDm $dm)
 {
     if (($result = $dm->beforeUpdate()) !== true) {
         return $result;
     }
     return $this->_getPwAnnounceDao()->updateAnnounce($dm->aid, $dm->getData());
 }
Example #2
0
 /**
  * 编辑公告处理
  *
  * @return void
  */
 public function doUpdateAction()
 {
     list($aid, $url) = $this->getInput(array('aid', 'url'), 'post');
     if ($aid < 1) {
         $this->showError('operate.fail');
     }
     $dm = new PwAnnounceDm($aid);
     $url && ($url = WindUrlHelper::checkUrl($url));
     $dm->setContent($this->getInput('content', 'post'))->setEndDate($this->getInput('end_date', 'post'))->setStartDate($this->getInput('start_date', 'post'))->setSubject($this->getInput('subject', 'post'))->setTypeid($this->getInput('typeid', 'post'))->setUrl($url)->setUid($this->loginUser->uid)->setVieworder($this->getInput('vieworder', 'post'));
     if (($result = $this->_getPwAnnounceDs()->updateAnnounce($dm)) instanceof PwError) {
         $this->showError($result->getError());
     }
     $this->showMessage('operate.success', 'announce/announce/run');
 }