public function Save(HighValueRule $highValueRule) { try { $SQL = self::$INSERT; if ($highValueRule->getSeq() != null && $highValueRule->getSeq() != "" && $highValueRule->getSeq() > 0) { $SQL = self::$UPDATE; } $conn = self::$db->getConnection(); $stmt = $conn->prepare($SQL); $stmt->bindValue(':folderseq', $highValueRule->getFolderSeq()); $stmt->bindValue(':email', $highValueRule->getEmail()); $stmt->bindValue(':mobile', $highValueRule->getMobile()); $stmt->bindValue(':parameterchannelno', $highValueRule->getParameter()); $stmt->bindValue(':highvalue', $highValueRule->getHighValue()); $stmt->bindValue(':frequency', $highValueRule->getFrequency()); $isActive = 0; if ($highValueRule->getIsActive() == "true" || $highValueRule->getIsActive() == 1) { $isActive = 1; } $stmt->bindValue(':isactive', $isActive); $stmt->bindValue(':rulehits', $highValueRule->getRuleHits()); $type = $highValueRule->getStationType(); $maxSeq = $highValueRule->getLastRuleHitFileDataSeq(); $seq = $highValueRule->getSeq(); if (empty($seq)) { if ($type == "stack" || $type == "effluent") { $wqdsds = WQDStackDataStore::getInstance(); $maxSeq = $wqdsds->getMaxSeq(); } else { $WQDDS = WQDDataDataStore::getInstance(); $maxSeq = $WQDDS->getMaxSeq(); } } $highValueRule->setLastRuleHitFileDataSeq($maxSeq); //$stmt->bindValue(':lastrulehitwqdfiledataseq',$maxSeq); $stmt->bindValue(':lastrulehitwqdfiledataseq', $highValueRule->getLastRuleHitFileDataSeq()); if ($SQL == self::$UPDATE) { $stmt->bindValue(':seq', $highValueRule->getSeq()); } else { $stmt->bindValue(':rulestartwqdfiledataseq', $maxSeq); } $stmt->execute(); $error = $stmt->errorInfo(); if ($error[2] != "") { throw new Exception($error[2]); } } catch (Exception $e) { $logger = Logger::getLogger($ConstantsArray["logger"]); $logger->error("Error During Save High Value Rule : - " . $e->getMessage()); } }