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

Mister Spy

Current Path : /home/caballoscriollos/www/espanol/library/
Upload File :
Current File : /home/caballoscriollos/www/espanol/library/class.lotedeps.php

<?php 

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

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

		if (!($oRes = $this->GetQuery($sql)))
			return false;

		$arr = array();

		while ($oRow = $oRes->GetRow())
		{
			$oLoteDep = new LoteDep();
			$oLoteDep->ParseFromArray($oRow);

			array_push($arr, $oLoteDep);

			$oRes->MoveNext();
		}

		return $arr;
	}
	

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

	public function Create(LoteDep $oLoteDep)
	{
		$arr = array
		(
			'IdLote'	=> DB::Number($oLoteDep->IdLote),
			'Pn'		=> DB::String($oLoteDep->Pn),
			'Pd'		=> DB::String($oLoteDep->Pd),
			'ApMat'		=> DB::String($oLoteDep->ApMat),
			'Pf'		=> DB::String($oLoteDep->Pf),
			'Ce'		=> DB::String($oLoteDep->Ce),
			'Leche'		=> DB::String($oLoteDep->Leche)
		);
		
		if (!$this->Insert('tblLoteDeps', $arr))
			return false;
			
		return $oLoteDep;
	}
	
	
	public function Update(LoteDep $oLoteDep)
	{
		$where = " IdLoteDep = " . DB::Number($oLoteDep->IdLoteDep);
		
		$arr = array
		(
			'IdLote'	=> DB::Number($oLoteDep->IdLote),
			'Pn'		=> DB::String($oLoteDep->Pn),
			'Pd'		=> DB::String($oLoteDep->Pd),
			'ApMat'		=> DB::String($oLoteDep->ApMat),
			'Pf'		=> DB::String($oLoteDep->Pf),
			'Ce'		=> DB::String($oLoteDep->Ce),
			'Leche'		=> DB::String($oLoteDep->Leche)
		);
		
		if (!DBAccess::Update('tblLoteDeps', $arr, $where))
			return false;
		
		return $oLoteDep;
	}
	

	public function Delete($IdLoteDep)
	{
		if (!DBAccess::$db->Begin())
			return false;
			
		$where = " IdLoteDep = " . DB::Number($IdLoteDep);
		if (!DBAccess::Delete('tblLoteDeps', $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('tblLoteDeps', $where))
		{
				DBAccess::$db->Rollback();	
				return false;
		}

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

?>

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