public function actionWrite() { if (isset($_POST['Wfgroup'])) { $messages = $this->ValidateData(array(array($_POST['Wfgroup']['workflowid'], 'emptywfname', 'emptystring'), array($_POST['Wfgroup']['groupaccessid'], 'emptygroupname', 'emptystring'), array($_POST['Wfgroup']['wfbefstat'], 'emptywfbefstat', 'emptystring'), array($_POST['Wfgroup']['wfrecstat'], 'emptywfrecstat', 'emptystring'))); if ($messages == '') { if ((int) $_POST['Wfgroup']['wfgroupid'] > 0) { $model = $this->loadModel($_POST['Wfgroup']['wfgroupid']); $model->workflowid = $_POST['Wfgroup']['workflowid']; $model->groupaccessid = $_POST['Wfgroup']['groupaccessid']; $model->wfbefstat = $_POST['Wfgroup']['wfbefstat']; $model->wfrecstat = $_POST['Wfgroup']['wfrecstat']; $model->recordstatus = $_POST['Wfgroup']['recordstatus']; } else { $model = new Wfgroup(); $model->attributes = $_POST['Wfgroup']; } try { if ($model->save()) { $this->DeleteLock($this->menuname, $_POST['Wfgroup']['wfgroupid']); $this->GetSMessage('scoinsertsuccess'); } else { $this->GetMessage($model->getErrors()); } } catch (Exception $e) { $this->GetMessage($e->getMessage()); } } } }