protected void lbtSearchAdv_Click(object sender, EventArgs e) { try { txtNroComprobante.Text = ""; //Reset for changed TAB ServicioEX.FiltrosDocumentoSunat filtros = WSEX.NewFiltrosDocumentoSunat(); ServicioEX.Orden[] OrdenarPor = new ServicioEX.Orden[1]; filtros.Corporacion = 1; filtros.Compania = 2; filtros.ClienteNroDocumento = oCliente.ruc; if (!drpTipoComprobante.SelectedValue.Equals(string.Empty)) { filtros.GrupoDocumentos = drpTipoComprobante.SelectedValue; filtros.SunatTipoDoc = new string[] { drpTipoComprobante.SelectedValue }; } if (!drpTipoServicio.SelectedValue.Equals(string.Empty)) { filtros.CodigoGrupoSistema = new string[] { drpTipoServicio.SelectedValue }; } if (!txtFechaIni.Text.Equals(string.Empty)) { filtros.FechaEmisionInicial = Int32.Parse((Convert.ToDateTime(txtFechaIni.Text)).ToString("yyyyMMdd")); } if (!txtFechaFin.Text.Equals(string.Empty)) { filtros.FechaEmisionFinal = Int32.Parse((Convert.ToDateTime(txtFechaFin.Text)).ToString("yyyyMMdd")); } filtros.EstadosSUNAT = new string[] { "1" }; ServicioEX.Orden orden = new ServicioEX.Orden(); orden.Campo = "COMPROBANTE_FECHA"; orden.Secuencia = rbtOrdenarAsc.Checked ? "ASC" : "DESC"; OrdenarPor[0] = orden; BindResultados(filtros, OrdenarPor); RegistrarLog.BusquedaDocumento(oContacto, "TipoComprobante=" + drpTipoComprobante.SelectedValue + ", TipoServicio=" + drpTipoServicio.SelectedValue + ", Rango=" + txtFechaIni.Text + " : " + txtFechaFin.Text); } catch (Exception ex) { Trace.Warn("WS Facturacion Error", ex.Message); lblError.Text = "Lo sentimos, el servicio no esta disponible en este momento.<br />" + ex.Message; } }
protected void lbtSearch_Click(object sender, EventArgs e) { try { ServicioEX.FiltrosDocumentoSunat filtros = WSEX.NewFiltrosDocumentoSunat(); ServicioEX.Orden[] OrdenarPor = new ServicioEX.Orden[] { }; if (txtNroComprobante.Text.Length < 5) { lblError.Text = "(*) Formato de Documento Inválido"; return; } filtros.Corporacion = 1; filtros.Compania = 2; filtros.GrupoDocumentos = string.Empty; //FA, BO ??? filtros.ClienteNroDocumento = oCliente.ruc; switch (drpTipoDocumento.SelectedValue) { case "SUNAT": filtros.Sunpre = txtNroComprobante.Text.Substring(1, 3); filtros.SunatTipoDoc = new string[] { get_SunatTipoDoc(txtNroComprobante.Text.Substring(0, 1)) }; filtros.CorrelativoDesde = txtNroComprobante.Text.Substring(5); break; case "OC": filtros.NumeroReferencia = txtNroComprobante.Text; break; } //ServicioEX.Orden orden = WSEX.NewOrden(); //orden.Campo = "COMPROBANTE_TIPO"; //orden.Secuencia = "ASC"; //OrdenarPor.Add(orden); BindResultados(filtros, OrdenarPor); RegistrarLog.BusquedaDocumento(oContacto, "TipoDocumento=" + drpTipoDocumento.SelectedValue + ", NroComprobante=" + txtNroComprobante.Text); } catch (Exception ex) { Trace.Warn("WS Facturacion Error", ex.Message); lblError.Text = "Lo sentimos, el servicio no esta disponible en este momento.<br />" + ex.Message; } }