示例#1
0
 function assign_post()
 {
     $temp = parent::runquery("SELECT staff_id FROM position WHERE post_id = ?", array($this->post_id));
     if ($temp[0]["staff_id"] != "" && $temp[0]["staff_id"] != $this->staff_id) {
         ExceptionHandler::PushException(str_replace("%0%", $temp[0]["staff_id"], POST_HAS_DETERMINED_ERR));
         return false;
     }
     parent::runquery("update position set staff_id=" . $this->staff_id . " where post_id=" . $this->post_id);
     $daObj = new DataAudit();
     $daObj->ActionType = DataAudit::Action_update;
     $daObj->RelatedPersonType = DataAudit::PersonType_staff;
     $daObj->RelatedPersonID = $this->staff_id;
     $daObj->MainObjectID = $this->post_id;
     $daObj->TableName = "position";
     $daObj->description = "انتساب پست اجرایی به هیئت علمی";
     $daObj->execute();
     //------------------ baseinfo update ---------------------------
     $staffObj = new manage_staff("", "", $this->staff_id);
     require_once inc_manage_post;
     manage_posts::baseinfoAssign($staffObj->PersonID, $this->post_id, date("Y-m-d"), "انتساب پست اجرایی به هیئت علمی");
     //--------------------------------------------------------------
     return true;
 }