Beispiel #1
0
 function Remove($pdo = null)
 {
     $dt = parent::runquery("select * from PLN_Elements where GroupID=?", array($this->GroupID));
     if (count($dt) > 0) {
         return false;
     }
     parent::Remove($pdo);
 }
Beispiel #2
0
 public static function GetContractItems($ContractID)
 {
     $CntObj = new CNT_contracts($ContractID);
     $res_cnt = array(array("TemplateItemID" => 1, "ItemValue" => $CntObj->StartDate), array("TemplateItemID" => 2, "ItemValue" => $CntObj->EndDate), array("TemplateItemID" => 3, "ItemValue" => $CntObj->_PersonName));
     $res = parent::runquery("select * from " . static::TableName . " where ContractID=:ContractID", array(":ContractID" => $ContractID));
     //  echo PdoDataAccess::GetLatestQueryString();
     return array_merge($res_cnt, $res);
 }
Beispiel #3
0
 public function Remove($pdo = null)
 {
     $res = parent::runquery("select count(*) from CNT_ContractItems where TemplateItemID = ? limit 1", array($this->TemplateItemID), $pdo);
     if ($res[0]['count(*)'] > 0) {
         throw new Exception(self::UsedTemplateItem);
         /*parent::PushException("UsedTemplateItem");            return false;*/
     }
     return parent::Remove($pdo);
 }
Beispiel #4
0
 function Add($pdo = null)
 {
     $dt = self::Get(" AND ChequeNo=? AND ChequeDate=?", array($this->ChequeNo, DateModules::shamsi_to_miladi($this->ChequeDate)));
     if ($dt->rowCount() > 0) {
         ExceptionHandler::PushException("چک دیگری با این شماره و تاریخ قبلا ثبت شده است");
         return false;
     }
     return parent::Add($pdo);
 }
Beispiel #5
0
 public function Remove($pdo = null)
 {
     $dt = parent::runquery("select * from BSC_persons where PostID=?", array($this->PostID), $pdo);
     if (count($dt) > 0) {
         ExceptionHandler::PushException("این پست به فردی نسبت داده شده است و قابل حذف نمی باشد");
         return false;
     }
     $this->IsActive = "NO";
     return $this->Edit($pdo);
 }
Beispiel #6
0
 public function __construct($id = '')
 {
     $this->DT_ReminderDate = DataMember::CreateDMA(DataMember::DT_DATE);
     parent::__construct($id);
 }
Beispiel #7
0
 static function Get($where = '', $whereParams = array())
 {
     return parent::runquery_fetchMode("select f.*,GroupDesc \n\t\t\tfrom VOT_FormItems f join VOT_FormGroups g using(GroupID)\n\t\t\twhere 1=1 " . $where, $whereParams);
 }
Beispiel #8
0
 function __construct($id = "")
 {
     $this->DT_EventDate = DataMember::CreateDMA(DataMember::DT_DATE);
     parent::__construct($id);
 }
Beispiel #9
0
 static function Get($where = '', $whereParams = array(), $order = "")
 {
     return parent::runquery_fetchMode("\r\n\t\t\tSELECT i.*,InfoDesc ObjectDesc,bf.param1,bf.param2,bf.param3,\r\n\t\t\t\tconcat_ws(' ',fname,lname,CompanyName) fullname,\r\n\t\t\t\td.DocumentID,d.DocDesc,d.ObjectType,d.IsConfirm, \r\n\t\t\t\tif(count(df.RowID) >0,'true','false') HaveFile\t\r\n\t\t\t\t\r\n\t\t\tFROM DMS_PackageItems i\r\n\t\t\tjoin BaseInfo bf on(TypeID=11 AND ObjectType=InfoID)\r\n\r\n\t\t\tleft join LON_requests\to1 on(i.ObjectType=1 AND i.ObjectID=RequestID)\r\n\t\t\tleft join CNT_contracts\to3 on(i.ObjectType=2 AND i.ObjectID=ContractID)\r\n\t\t\tleft join PLN_plans\t\to2 on(i.ObjectType=3 AND i.ObjectID=PlanID)\r\n\t\t\t\r\n\t\t\tleft join BSC_persons p on(\tp.PersonID=o1.LoanPersonID or \r\n\t\t\t\t\t\t\t\t\t\tp.PersonID=o2.PersonID or\r\n\t\t\t\t\t\t\t\t\t\tp.PersonID=o3.PersonID or p.PersonID=o3.PersonID2)\r\n\r\n\t\t\tleft join DMS_documents d on(d.ObjectType=param4 AND i.ObjectID=d.ObjectID)\r\n\t\t\tleft join DMS_DocFiles df using(DocumentID)\r\n\t\t\t\r\n\t\t\twhere 1=1" . $where . " " . $order . "\r\n\t\t\t\r\n\t\t\tgroup by d.DocumentID\r\n\t\t\t", $whereParams);
 }
Beispiel #10
0
 static function Get($where = '', $whereParams = array())
 {
     $query = "select t.*,concat(p1.fname,' ',p1.lname) fullname,\r\n\t\t\t\tbf1.InfoDesc GoMeanDesc,bf2.InfoDesc ReturnMeanDesc,bf3.InfoDesc OffTypeDesc,\r\n\t\t\t\tconcat(p2.fname,' ',p2.lname) OffFullname,\r\n\t\t\t\tconcat(p3.fname,' ',p3.lname) SurveyFullname\r\n\t\t\tfrom ATN_requests t\r\n\t\t\tjoin BSC_persons p1 using(PersonID)\r\n\t\t\tleft join BSC_persons p2 on(OffPersonID=p2.PersonID)\r\n\t\t\tleft join BSC_persons p3 on(SurveyPersonID=p3.PersonID)\r\n\t\t\tleft join BaseInfo bf1 on(bf1.TypeID=21 AND bf1.InfoID=GoMean)\r\n\t\t\tleft join BaseInfo bf2 on(bf2.TypeID=21 AND bf2.InfoID=ReturnMean)\r\n\t\t\tleft join BaseInfo bf3 on(bf3.TypeID=20 AND bf3.InfoID=OffType)\r\n\t\t\twhere 1=1 " . $where;
     return parent::runquery_fetchMode($query, $whereParams);
 }
Beispiel #11
0
 function __construct($id = '')
 {
     $this->DT_FromDate = DataMember::CreateDMA(DataMember::DT_DATE);
     $this->DT_ToDate = DataMember::CreateDMA(DataMember::DT_DATE);
     parent::__construct($id);
 }
Beispiel #12
0
 static function Get($where = "", $param = array())
 {
     $query = "\n\t\t\tSELECT cb.*,\n\t\t\t\tcc.CostCode,\n\t\t\t\tconcat_ws('-', b1.blockDesc, b2.blockDesc, b3.blockDesc) CostDesc,\n\t\t\t\tbf1.InfoDesc TafsiliTypeDesc,\n\t\t\t\tTafsiliDesc\n\t\t\t\n\t\t\tFROM ACC_CostBlocks cb\n\n\t\t\tjoin ACC_CostCodes cc using(CostID)\n\t\t\tleft join ACC_blocks b1 on(cc.level1=b1.BlockID)\n\t\t\tleft join ACC_blocks b2 on(cc.level2=b2.BlockID)\n\t\t\tleft join ACC_blocks b3 on(cc.level3=b3.BlockID)\n\n\t\t\tjoin BaseInfo bf1 on(bf1.TypeID=2 AND bf1.InfoID=cb.TafsiliType)\n\t\t\tjoin ACC_tafsilis using(TafsiliID)\n\t\t";
     return parent::runquery_fetchMode($query, $param);
 }