32 bool existeDocumento =
false, llOk =
true;
33 DataTable numeroDataTable =
new DataTable();
35 llOk = DB.SQLExec(
"SELECT NUMERO " +
36 "FROM " + DB.SQLDatabase(tcDatabase, tcTabla) +
" " +
37 "WHERE EMPRESA = " + DB.SQLString(tcEmpresa) +
" " +
38 "AND NUMERO = " + DB.SQLString(tcEjercicio.Trim()), ref numeroDataTable);
40 if (llOk && numeroDataTable.Rows.Count > 0)
41 existeDocumento =
true;
43 return existeDocumento;
67 lcSql =
"update " + DB.SQLDatabase(
"comunes",
"d_leglbr") +
" set linea=abs(linea)*-1 " +
68 "where empresa=" + DB.SQLString(tcEmpresa) +
" and numero=" + DB.SQLString(toLegalizacionLibros.
_Numero);
69 llOk = DB.SQLExec(lcSql);
76 lcSql =
"update " + DB.SQLDatabase(
"comunes",
"d_leglbr") +
" set linea=abs(linea) " +
77 "where empresa=" + DB.SQLString(tcEmpresa) +
" and numero=" + DB.SQLString(toLegalizacionLibros.
_Numero);
88 DataTable ldtLineas =
new DataTable();
89 lcSql =
"select tipo, linea from " + DB.SQLDatabase(
"comunes",
"d_leglbr") +
" " +
90 "where empresa=" + DB.SQLString(tcEmpresa) +
" and numero=" + DB.SQLString(toLegalizacionLibros.
_Numero) +
" " +
91 "order by tipo, num_libro";
92 llOk = DB.SQLExec(lcSql, ref ldtLineas);
96 int lnAntiguaLinea = 0;
101 foreach (
string tcTipoLibro
in lstTiposLibro)
105 DataRow[] laRows = ldtLineas.Select(
"tipo=" + DB.SQLString(tcTipoLibro));
109 for (
int ln_i = 0; ln_i < laRows.Length; ln_i++)
111 lnAntiguaLinea = Convert.ToInt32(laRows[ln_i][
"linea"]);
112 lcSql =
"update " + DB.SQLDatabase(
"comunes",
"d_leglbr") +
" set linea=" + Convert.ToString(lnNuevaLinea).Trim() +
" " +
113 "where empresa=" + DB.SQLString(tcEmpresa) +
" and numero=" + DB.SQLString(toLegalizacionLibros._Numero) +
" " +
114 "and tipo=" + DB.SQLString(tcTipoLibro) +
" and linea=" + Convert.ToString(lnAntiguaLinea).Trim();
115 llOk = DB.SQLExec(lcSql);