public override bool Editar()
{
ConexionDb conexion = new ConexionDb();
bool retorno = false;
try {
retorno = conexion.Ejecutar(String.Format("Update Presupuestos Set UsuarioId = {0}, Descripcion = '{1}' Where PresupuestoId = {2} --", this.UsuarioId, this.Descripcion, this.PresupuestoId));
if (retorno)
{
conexion.Ejecutar(String.Format("Delete from PresupuestoDetalle Where PresupuestoId = {0} --", this.PresupuestoId));
foreach (PresupuestoDetalle pd in Detalle)
{
conexion.Ejecutar(String.Format("Insert Into PresupuestoDetalle (PresupuestoId,TipoEgresoId,Monto) Values ({0},{1},{2})--", this.PresupuestoId, pd.TipoEgresoId, pd.Monto));
}
}
}
catch
{
retorno = false;
}
return retorno;
}