public function guardar() { if (!parent::guardar()) { return false; } $db = TBase::conectaDB(); $rs = $db->Execute("select idItem from servicio where idItem = " . $this->getId()); if ($rs->EOF) { $rs = $db->Execute("INSERT INTO servicio (idItem, precio, impInc, imp) VALUES (" . $this->getId() . ", 0, 'S', 0)"); } $rs = $db->Execute("UPDATE servicio\n\t\t\tSET\n\t\t\t\tprecio = " . $this->getPrecio() . ",\n\t\t\t\timpInc = '" . $this->impInc . "',\n\t\t\t\timp = " . $this->getImpuesto() . "\n\t\t\tWHERE idItem = " . $this->getId()); return $rs ? true : false; }
/** * Guarda los datos en la base de datos, si no existe un identificador entonces crea el objeto * * @autor Hugo * @access public * @return boolean True si se realizó sin problemas */ public function guardar() { $db = TBase::conectaDB(); //if ($this->idItem == '') if (!parent::guardar()) { return false; } $rs = $db->Execute("select idItem from serigrafia where idItem = " . $this->idItem); if ($rs->EOF) { $rs = $db->Execute("INSERT INTO serigrafia(idItem) VALUES(" . $this->idItem . ");"); if (!$rs) { return false; } } if ($this->getId() == '') { return false; } $rs = $db->Execute("UPDATE serigrafia\n\t\t\tSET\n\t\t\t\tdescripcion = '" . $this->getDescripcion() . "'\n\t\t\tWHERE idItem = " . $this->idItem); return $rs ? true : false; }
/** * Guarda los datos en la base de datos, si no existe un identificador entonces crea el objeto * * @autor Hugo * @access public * @return boolean True si se realizó sin problemas */ public function guardar() { $db = TBase::conectaDB(); //if ($this->idItem == '') if (!parent::guardar()) { return false; } if ($this->getId() == '') { return false; } $rs = $db->Execute("UPDATE otrastecnicas\n\t\t\tSET\n\t\t\t\tdescripcion = '" . $this->getDescripcion() . "'\n\t\t\tWHERE idItem = " . $this->idItem); return $rs ? true : false; }
/** * Guarda los datos en la base de datos, si no existe un identificador entonces crea el objeto * * @autor Hugo * @access public * @return boolean True si se realizó sin problemas */ public function guardar() { $db = TBase::conectaDB(); //if ($this->idItem == '') if (!parent::guardar()) { return false; } $rs = $db->Execute("select idItem from otros where idItem = " . $this->idItem); if ($rs->EOF) { $rs = $db->Execute("INSERT INTO otros(idItem) VALUES(" . $this->idItem . ");"); if (!$rs) { return false; } } if ($this->getId() == '') { return false; } $rs = $db->Execute("UPDATE otros\n\t\t\tSET\n\t\t\t\tdescripcion = '" . $this->getDescripcion() . "',\n\t\t\t\tprecio = " . ($this->getPrecio() != '' ? $this->getPrecio() : 0) . "\n\t\t\tWHERE idItem = " . $this->idItem); return $rs ? true : false; }
public function guardar() { if (!parent::guardar()) { return false; } $db = TBase::conectaDB(); $rs = $db->Execute("select idItem from producto where idItem = " . $this->getId()); if ($rs->EOF) { $rs = $db->Execute("INSERT INTO producto (idItem, idDepartamento, idTipoCosteo, costo, precio, impInc, imp, marca, minimo, existencias) VALUES (" . $this->getId() . ",\n" . $this->getIdDepartamento() . ", " . $this->getIdTipoCosteo() . ", 0, 0, 'S', 0, '', 0, 0)"); } $rs = $db->Execute("UPDATE producto\n\t\t\tSET\n\t\t\t\tidDepartamento = " . $this->getIdDepartamento() . ",\n\t\t\t\tidTipoCosteo = " . $this->getIdTipoCosteo() . ",\n\t\t\t\tcosto = " . $this->getCosto() . ",\n\t\t\t\tprecio = " . $this->getPrecio() . ",\n\t\t\t\timpInc = '" . $this->impInc . "',\n\t\t\t\timp = " . $this->getImpuesto() . ",\n\t\t\t\tmarca = '" . $this->getMarca() . "',\n\t\t\t\tminimo = " . $this->getMinimo() . ",\n\t\t\t\texistencias = " . $this->getExistencias() . "\n\t\t\tWHERE idItem = " . $this->getId()); return $rs ? true : false; }