示例#1
0
 function UpdateAccount()
 {
     if (!$this->AccountNoValidity()) {
         return false;
     }
     if (!parent::update("ACC_accounts", $this, 'AccountID=:ACId', array(':ACId' => $this->AccountID))) {
         return false;
     }
     $dt = PdoDataAccess::runquery("select * from ACC_tafsilis where ObjectID=? AND TafsiliType=3", array($this->AccountID));
     if (count($dt) == 0) {
         $obj = new ACC_tafsilis();
         $obj->ObjectID = $this->AccountID;
         $obj->TafsiliCode = $this->AccountNo;
         $obj->TafsiliDesc = $this->AccountDesc;
         $obj->TafsiliType = "3";
         $obj->AddTafsili();
     } else {
         $obj = new ACC_tafsilis($dt[0]["TafsiliID"]);
         $obj->TafsiliCode = $this->AccountNo;
         $obj->TafsiliDesc = $this->AccountDesc;
         $obj->EditTafsili();
     }
     $daObj = new DataAudit();
     $daObj->ActionType = DataAudit::Action_update;
     $daObj->MainObjectID = $this->AccountID;
     $daObj->TableName = "ACC_accounts";
     $daObj->execute();
     return true;
 }
示例#2
0
 function EditPerson()
 {
     if ($this->UserName != "") {
         $dt = PdoDataAccess::runquery("select * \r\n\t\t\t\tfrom BSC_persons where PersonID<>? AND UserName=?", array($this->PersonID, $this->UserName));
         if (count($dt) > 0) {
             ExceptionHandler::PushException("شناسه وارد شده تکراری است");
             return false;
         }
     }
     if (parent::update("BSC_persons", $this, " PersonID=:l", array(":l" => $this->PersonID)) === false) {
         return false;
     }
     $daObj = new DataAudit();
     $daObj->ActionType = DataAudit::Action_update;
     $daObj->MainObjectID = $this->PersonID;
     $daObj->TableName = "BSC_persons";
     $daObj->execute();
     $dt = PdoDataAccess::runquery("select * from ACC_tafsilis where ObjectID=? AND TafsiliType=1", array($this->PersonID));
     require_once getenv("DOCUMENT_ROOT") . '/accounting/baseinfo/baseinfo.class.php';
     if (count($dt) == 0) {
         $obj = new ACC_tafsilis();
         $obj->ObjectID = $this->PersonID;
         $obj->TafsiliCode = $this->PersonID;
         $obj->TafsiliDesc = $this->IsReal == "YES" ? $this->fname . " " . $this->lname : $this->CompanyName;
         $obj->TafsiliType = "1";
         $obj->AddTafsili();
     } else {
         $obj = new ACC_tafsilis($dt[0]["TafsiliID"]);
         $obj->TafsiliCode = $this->PersonID;
         $obj->TafsiliDesc = $this->IsReal == "YES" ? $this->fname . " " . $this->lname : $this->CompanyName;
         $obj->EditTafsili();
     }
     return true;
 }