public void OnReadData_st_grilla(object sender, StoreReadDataEventArgs e) { try { int start = e.Start; int limit = NumInt.Init(e.Parameters.GetParameter("limit").Value); limit = limit == 0 ? e.Limit : limit; int page = (start / limit) + 1; co_tg_mandantes_no Nomina = new co_tg_mandantes_no(); Nomina.Pagina = page; Nomina.RegistrosPorPaginas = e.Limit; Nomina.ColumnaOrden = e.Sort[0].Property; Nomina.OrdenColumna = (FwpServerControls.FwpDataGridDataBound.Orden) Enum.Parse(typeof(FwpServerControls.FwpDataGridDataBound.Orden), e.Sort[0].Direction.ToString(), true); IList<object> lista = new List<object>(); AgregarFiltros_st_grilla(ref Nomina); Nomina<co_tg_mandantes_no> data = new bf_tg_mandantes().GetNomina(Nomina); foreach (co_tg_mandantes_no n in data.DataSource) { lista.Add( new { id_mandante = n.id_mandante, ma_mandante = n.ma_mandante, ma_descripcion = n.ma_descripcion, ma_rut= Validacion.FormatRut(n.ma_rut), id_persona = n.id_persona, pe_nombrecompleto = n.pe_nombrecompleto }); } st_grilla.DataSource = lista; (st_grilla.Proxy[0] as PageProxy).Total = data.Registros; st_grilla.DataBind(); } catch (Exception ex) { Mensajes.Error(ex.Message); } }
private void AgregarFiltros_st_grilla(ref co_tg_mandantes_no nomina) { nomina.ma_mandante = FiltrosNomina.ValidarFiltros<string>(nomina.ma_mandante, filtertxt_ma_mandante.Text); nomina.ma_descripcion = FiltrosNomina.ValidarFiltros<string>(nomina.ma_descripcion, filtertxt_ma_descripcion.Text); if (!string.IsNullOrEmpty(filtercbx_id_persona.SelectedItem.Value)) { nomina.id_persona = FiltrosNomina.ValidarFiltros<int>(0, filtercbx_id_persona.SelectedItem.Value); } }