public function actionWrite() { parent::actionWrite(); if (isset($_POST['Jobs'])) { $messages = $this->ValidateData(array(array($_POST['Jobs']['orgstructureid'], 'emptyorgstructure', 'emptystring'), array($_POST['Jobs']['jobdesc'], 'emptyjobdesc', 'emptystring'), array($_POST['Jobs']['qualification'], 'emptyqualification', 'emptystring'))); if ($messages == '') { //$dataku->attributes=$_POST['Absstatus']; if ((int) $_POST['Jobs']['jobsid'] > 0) { $model = $this->loadModel($_POST['Jobs']['jobsid']); $model->orgstructureid = $_POST['Jobs']['orgstructureid']; $model->positionid = $_POST['Jobs']['positionid']; $model->jobdesc = $_POST['Jobs']['jobdesc']; $model->qualification = $_POST['Jobs']['qualification']; $model->recordstatus = $_POST['Jobs']['recordstatus']; } else { $model = new Jobs(); $model->attributes = $_POST['Jobs']; } try { if ($model->save()) { $this->DeleteLock($this->menuname, $_POST['Jobs']['jobsid']); $this->GetSMessage('homjoinsertsuccess'); } else { $this->GetMessage($model->getErrors()); } } catch (Exception $e) { $this->GetMessage($e->getMessage()); } } } }