/// <summary> /// btnBuscar_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnBuscar_Click(object sender, EventArgs e) { try { lblMensajeError.InnerText = ""; //WS-SINIESTRO IwsSiniestroClient owsSiniestroClient = new IwsSiniestroClient(); //Parametros enSiniestro oEnSiniestro = new enSiniestro(); oEnSiniestro.NumPoliza = txtNumPoliza.Value; oEnSiniestro.Tipo = cmbTipoSiniestro.Value.ToString(); oEnSiniestro.vFechaRegistro = txtFechaSiniestro.Value; //Obtiene Listado de Siniestros List <enSiniestro> loEnSiniestro = owsSiniestroClient.ListarSiniestro(oEnSiniestro).Cast <enSiniestro>().ToList(); rptListadoSiniestros.DataSource = loEnSiniestro; rptListadoSiniestros.DataBind(); } catch (Exception ex) { //throw ex; //lblMensajeError.InnerText = ex.Message; hddMensajeError.Value = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { try { //Controla Mostrar Mensaje string strMensaje = (string)HttpContext.Current.Session["SINIESTRO_MENSAJE"]; if (strMensaje == null) { strMensaje = ""; } HttpContext.Current.Session.Remove("SINIESTRO_MENSAJE"); hddMensaje.Value = strMensaje; //Controla Mostrar MensajeError string strMensajeError = (string)HttpContext.Current.Session["SINIESTRO_MENSAJE_ERROR"]; if (strMensaje == null) { strMensaje = ""; } HttpContext.Current.Session.Remove("SINIESTRO_MENSAJE_ERROR"); hddMensajeError.Value = strMensajeError; //lblMensajeError.InnerText = ""; //IsPostBack if (!this.IsPostBack) { List <String> tipoSiniestro = Utilitario.getTipoSiniestro(); cmbTipoSiniestro.Items.Clear(); cmbTipoSiniestro.Items.Add(new ListItem { Value = "", Text = "[SELECCIONE]" }); foreach (string tipo in tipoSiniestro) { cmbTipoSiniestro.Items.Add(tipo); } //WS-SINIESTRO IwsSiniestroClient owsSiniestroClient = new IwsSiniestroClient(); //Parametros enSiniestro oEnSiniestro = new enSiniestro(); //Obtiene Listado de Siniestros List <enSiniestro> loEnSiniestro = owsSiniestroClient.ListarSiniestro(oEnSiniestro).Cast <enSiniestro>().ToList(); rptListadoSiniestros.DataSource = loEnSiniestro; rptListadoSiniestros.DataBind(); } } catch (Exception ex) { //throw ex; //lblMensajeError.InnerText = ex.Message; hddMensajeError.Value = ex.Message; } }