Ejemplo n.º 1
0
    private string ObtenerDestFact(string sIdCliente, string sOVSAP)
    {
        try
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("<table id='tblDatos' class='texto MA' style='width: 900px;'>");
            sb.Append("<colgroup>");
            sb.Append("     <col style='width:340px;'>");
            sb.Append("     <col style='width:200px;'>");
            sb.Append("     <col style='width:60px;'>");
            sb.Append("     <col style='width:200px;'>");
            sb.Append("     <col style='width:100px;'>");
            sb.Append("</colgroup>");
            sb.Append("<tbody>");

            SqlDataReader dr = CLIENTE.ObtenerDestinatariosDeFactura(int.Parse(sIdCliente), sOVSAP);

            while (dr.Read())
            {
                sb.Append("<tr id='" + dr["t302_idcliente"].ToString() + "' ");
                sb.Append(" nif='" + dr["NIF"].ToString() + "' ");
                sb.Append(" onclick=\"ms(this)\" ondblclick=\"aceptarClick(this.rowIndex)\" style='height:16px;' onmouseover='TTip(event)'>");

                sb.Append("<td style='padding-left:5px;'><nobr class='NBR W330'>" + dr["t302_denominacion"].ToString() + "</nobr></td>");
                sb.Append("<td><nobr class='NBR W190'>" + dr["direccion"].ToString() + "</nobr></td>");
                sb.Append("<td>" + dr["cp"].ToString() + "</td>");
                sb.Append("<td><nobr class='NBR W190'>" + dr["poblacion"].ToString() + "</nobr></td>");
                sb.Append("<td><nobr class='NBR W90'>" + dr["pais"].ToString() + "</nobr></td>");
                sb.Append("</tr>");
            }
            dr.Close();
            dr.Dispose();

            sb.Append("</tbody>");
            sb.Append("</table>");

            return("OK@#@" + sb.ToString());
        }
        catch (Exception ex)
        {
            return("Error@#@" + Errores.mostrarError("Error al obtener los clientes destinatarios de factura", ex));
        }
    }