public bool AnularDetalle_De_Reserva(string idreserva) { try { consulta = "SELECT IDTERRENO FROM RESERVADETALLE WHERE IDRESERVA='" + idreserva + "'"; cnx.Insertar(consulta); DataSet ds = new DataSet(); cterreno obj = new cterreno(); ds = cnx.Listar(consulta, "TERRENO"); DataTable dt = ds.Tables[0]; //DataRow row = dt.Rows[0]; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow row = dt.Rows[i]; obj.CambiarLibre(row["IDTERRENO"].ToString()); } consulta = "UPDATE RESERVADETALLE SET ESTADORESERVA = 'ANULADO' WHERE IDRESERVA='" + idreserva + "'"; cnx.Insertar(consulta); return(true); } catch (Exception) { return(false); } }
public cterreno ObtenerRegistro(string idterr) { try { consulta = "SELECT * FROM TERRENO WHERE IDTERRENO='" + idterr + "'"; DataSet ds = new DataSet(); cterreno obj = new cterreno(); ds = cnx.Listar(consulta, "TERRENO"); // int cant = ds.Tables[0].Rows.Count; DataTable dt = ds.Tables[0]; DataRow row = dt.Rows[0]; obj.EstadoReserva = row["ESTADORESERVA"].ToString(); obj.MetrosCuadrados = row["METROS"].ToString(); obj.Precio = row["PRECIO"].ToString(); obj.Estado = row["ESTADO"].ToString(); return(obj); } catch (Exception) { throw; } }