protected void itemsPerDayStore_ReadData(object sender, Ext.Net.StoreReadDataEventArgs e) { // Sample data. Replace items from database IEnumerable <Item> Items = new Item[] { new Item { Itemid = 1, DayPurchased = DateTime.Today }, new Item { Itemid = 2, DayPurchased = DateTime.Today }, new Item { Itemid = 3, DayPurchased = DateTime.Today }, new Item { Itemid = 4, DayPurchased = DateTime.Today.AddDays(-1) }, new Item { Itemid = 5, DayPurchased = DateTime.Today.AddDays(-1) }, new Item { Itemid = 6, DayPurchased = DateTime.Today.AddDays(-2) } }; itemsPerDayStore.DataSource = Items.GroupBy(x => x.DayPurchased.Day).Select(x => new { Day = x.Key, Items = x.Count() }); itemsPerDayStore.DataBind(); }
protected void itemsPerDayStore_ReadData(object sender, Ext.Net.StoreReadDataEventArgs e) { // Sample data. Replace with items from database. IEnumerable <Item> Items = new Item[] { new Item { Itemid = 1, DayPurchased = "2018-01-01" }, new Item { Itemid = 2, DayPurchased = "2018-01-01" }, new Item { Itemid = 3, DayPurchased = "2018-01-01" }, new Item { Itemid = 4, DayPurchased = "2018-01-02" }, new Item { Itemid = 5, DayPurchased = "2018-01-02" }, new Item { Itemid = 6, DayPurchased = "2018-01-03" } }; itemsPerDayStore.DataSource = Items.GroupBy(x => x.DayPurchased).Select(x => new { Day = x.Key, Items = x.Count() }); itemsPerDayStore.DataBind(); }
public void OnReadData_st_cmb_id_persona(object sender, StoreReadDataEventArgs e) { IList<co_tg_personas> listPersonas = new bf_tg_personas().GetData(new co_tg_personas()).OrderBy(c => c.pe_nombrecompleto).ToList(); st_cmb_id_persona.DataSource = listPersonas; st_cmb_id_persona.DataBind(); }
/// <summary> /// Actualiza la lista de sucursales /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void OnReadData_sSucursales(object sender, StoreReadDataEventArgs e) { string strcliente = Cookies.GetCookie("cookieEditarCliente").Value; List<Sucursal> lSucursal = SucursalBusiness.ObtenerSucursalesPorCliente(strcliente); sSucursales.DataSource = lSucursal; sSucursales.DataBind(); }
/// <summary> /// Método para actualizar los registros /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void OnReadData_sMunicipios(object sender, StoreReadDataEventArgs e) { sMunicipios.DataSource = MunicipioBusiness.ObtenerMunicipios(); sMunicipios.DataBind(); sEstados.DataSource = EstadoBusiness.ObtenerEstados(); sEstados.DataBind(); }
protected void st_grilla_OnReadData(object sender, StoreReadDataEventArgs e) { 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_personas_no Nomina = new co_tg_personas_no(); Nomina.Pagina = page; Nomina.RegistrosPorPaginas = 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_personas_no> data = new bf_tg_personas().GetNomina(Nomina); foreach (co_tg_personas_no n in data.DataSource) { lista.Add( new { id_persona = n.id_persona, pe_nombrecompleto = n.pe_nombrecompleto, pe_nombres = n.pe_nombres, pe_appaterno = n.pe_appaterno, pe_apmaterno = n.pe_apmaterno, id_tiporut = n.id_tiporut, pe_rut = n.pe_rut, pe_fechaingreso = n.pe_fechaingreso.Fecha, pe_nacionalidad = n.pe_nacionalidad, pe_giro = n.pe_giro, pe_flgsinrut = n.pe_flgsinrut, pe_numctacte = n.pe_numctacte, id_estadocivil = n.id_estadocivil, pe_telefono = n.pe_telefono, pe_celular = n.pe_celular, id_banco = n.id_banco, pe_comuna = n.pe_comuna, pe_ciudad = n.pe_ciudad, pe_pais = n.pe_pais, pe_email = n.pe_email, pe_direccion = n.pe_direccion, id_pais = n.id_pais, id_comuna = n.id_comuna, id_ciudad = n.id_ciudad, }); } st_grilla.DataSource = lista; st_grilla.PageSize = limit; PageProxy pageProxy = st_grilla.Proxy[0] as PageProxy; if (pageProxy != null) pageProxy.Total = data.Registros; st_grilla.DataBind(); }
protected void CmbRemates_OnReadData(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; Nomina<co_re_remates_no> data = null; co_re_remates_no Nomina = new co_re_remates_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); if (hid_id_remate.Text != @"") { Nomina.id_remate = int.Parse(hid_id_remate.Text); data = new bf_re_remates().GetNomina(Nomina); } else { Nomina.id_remateEstadoWeb = Constantes.ESTADO_REMATE_PUBLICADO; Nomina.id_rematetipo = ID_REMATETIPO; Nomina.id_familia = Constantes.FAMILIA_PROPIEDADES; data = new bf_re_remates().GetNominaAgrupadosDisponibles(Nomina); } IList<object> lista = new List<object>(); foreach (co_re_remates_no no in data.DataSource) { lista.Add(new { id_remate = no.id_remate, rem_nombre = no.rem_nombre }); } strCmbRemates.DataSource = lista; strCmbRemates.PageSize = limit; PageProxy pageProxy = strCmbRemates.Proxy[0] as PageProxy; if (pageProxy != null) pageProxy.Total = data.Registros; strCmbRemates.DataBind(); if (hid_id_remate.Text != @"") { int id_remate = int.Parse(hid_id_remate.Text); cmbRemates.SetValueAndFireSelect(id_remate); } } catch (Exception ex) { Mensajes.Error(ErrorText.ERROR_CARGAR_REMATES_AGRUPADOS, "wf_agrupador_remates_adm.CmbRemates_OnReadData", ex); } }
protected virtual void OnReadData(StoreReadDataEventArgs e) { AjaxReadDataEventHandler handler = (AjaxReadDataEventHandler)Events[EventReadData]; if (handler != null) { handler(this, e); } }
protected void st_grilla_OnReadData(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_ca_usuarios_no Nomina = new co_ca_usuarios_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_ca_usuarios_no> data = new bf_ca_usuarios().GetNomina(Nomina); foreach (co_ca_usuarios_no n in data.DataSource) { lista.Add( new { id_usuario = n.id_usuario, id_persona = n.id_persona, pe_nombrecompleto = n.pe_nombrecompleto, us_esvigente = n.us_esvigente, us_ultimaconexion = n.us_ultimaconexion.Fecha, us_consuser = n.us_consuser, us_password = n.us_password, us_cambioPassword = n.us_cambioPassword, us_ultimoacceso = n.us_ultimoacceso.Fecha, us_feccambiopass = n.us_feccambiopass.Fecha, us_fechaexpiracion = n.us_fechaexpiracion.Fecha, us_intentosfallidos = n.us_intentosfallidos, }); } st_grilla.DataSource = lista; st_grilla.PageSize = limit; PageProxy pageProxy = st_grilla.Proxy[0] as PageProxy; if (pageProxy != null) pageProxy.Total = data.Registros; st_grilla.DataBind(); } catch (Exception ex) { Mensajes.Error(ex.Message); } }
protected void strCmbRemateTipo_OnReadData(object sender, StoreReadDataEventArgs e) { try { Combos.CargarRemateTipos(strCmbRemateTipo); } catch (Exception ex) { Mensajes.Error(ex.Message); } }
protected void StrRemates_OnReadData(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_re_remates_no Nomina = new co_re_remates_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> temp = new List<object>(); Nomina<co_re_remates_no> data = new bf_re_remates().GetNominaAgrupados(Nomina); foreach (co_re_remates_no n in data.DataSource) { temp.Add( new { rem_nombre = n.rem_nombre, rem_fechaagrupa = n.rem_fechaagrupa.Fecha, us_consuser = n.us_consuser, id_remate = n.id_remate, id_remate_base = n.id_remate_base.ToString(), rem_lugarRemate = n.rem_lugarRemate, rem_fecha = n.rem_fecha.Fecha, rem_nombreAgrupado = n.rem_nombreAgrupado + " - " + n.rem_fecha.Fecha.ToShortDateString() }); } strRemates.DataSource = temp; strRemates.PageSize = limit; PageProxy pageProxy = strRemates.Proxy[0] as PageProxy; if (pageProxy != null) pageProxy.Total = data.Registros; strRemates.DataBind(); } catch(Exception ex) { Mensajes.Error(ErrorText.ERROR_CARGAR_REMATES_AGRUPADOS, "wf_agrupador_remates.StrRemates_OnReadData" ,ex); } }
protected void strNoticias_OnReadData(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_re_noticias_no Nomina = new co_re_noticias_no(); Nomina.Pagina = page; Nomina.RegistrosPorPaginas = e.Limit; Nomina.ColumnaOrden = e.Sort[0].Property; Nomina.OrdenColumna = (FwpDataGridDataBound.Orden)Enum.Parse(typeof(FwpDataGridDataBound.Orden), e.Sort[0].Direction.ToString(), true); AgregarFiltros(ref Nomina); Nomina<co_re_noticias_no> data = new bf_re_noticias().GetNomina(Nomina); ICollection<object> list = new List<object>(); foreach (co_re_noticias_no no in data.DataSource) { list.Add(new { id_noticia = no.id_noticia, no_nodescripcion = no.no_nodescripcion, no_fechaPublicacion = no.no_fechaPublicacion.Fecha, no_vigente = no.no_vigente, no_titulo = no.no_titulo, no_bajadatitulo = no.no_bajadatitulo, no_fechaCreacion = no.no_fechaCreacion.Fecha, no_fechaExpiracion = no.no_fechaExpiracion.Fecha, id_noticiatipo = no.id_noticiatipo.id, noti_descripcion = no.id_noticiatipo.descripcion }); } strNoticias.DataSource = list; strNoticias.PageSize = limit; PageProxy pageProxy = strNoticias.Proxy[0] as PageProxy; if (pageProxy != null) pageProxy.Total = data.Registros; strNoticias.DataBind(); } catch (Exception ex) { Mensajes.Error(ex.Message); } }
protected void strAtributos_OnReadData(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_at_atributos_no Nomina = new co_at_atributos_no(); Nomina.Pagina = page; Nomina.RegistrosPorPaginas = limit; Nomina.ColumnaOrden = e.Sort[0].Property; Nomina.OrdenColumna = (FwpDataGridDataBound.Orden)Enum.Parse(typeof(FwpDataGridDataBound.Orden), e.Sort[0].Direction.ToString(), true); AplicarFiltros(ref Nomina); IList<object> lista = new List<object>(); Nomina<co_at_atributos_no> data = new bf_at_atributos().GetNomina(Nomina); foreach (co_at_atributos_no n in data.DataSource) { lista.Add( new { id_atributo = n.id_atributo, atri_Tatributo = n.atri_Tatributo, atri_Tsigla = n.atri_Tsigla, id_tipoDato = n.id_tipoDato, tida_TtipoDato = n.tida_TtipoDato, id_tabla = n.id_tabla, ta_tabla = n.ta_tabla, atri_Nalto = n.atri_Nalto, atri_NanchoCaja = n.atri_NanchoCaja, atri_Nndecimales = n.atri_Nndecimales, atri_Nlargo = n.atri_Nlargo }); } strAtributos.DataSource = lista; strAtributos.PageSize = limit; PageProxy pageProxy = strAtributos.Proxy[0] as PageProxy; if (pageProxy != null) pageProxy.Total = data.Registros; strAtributos.DataBind(); } catch (Exception ex) { Mensajes.Error(ex.Message); } }
protected 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_ca_menu_no nomina = new co_ca_menu_no(); nomina.Pagina = page; nomina.RegistrosPorPaginas = limit; nomina.ColumnaOrden = e.Sort[0].Property; nomina.OrdenColumna = (FwpDataGridDataBound.Orden) Enum.Parse(typeof(FwpDataGridDataBound.Orden), e.Sort[0].Direction.ToString(), true); IList<object> lista = new List<object>(); AgregarFiltros_st_grilla(ref nomina); Nomina<co_ca_menu_no> data = new bf_ca_menu().GetNomina(nomina); foreach (co_ca_menu_no n in data.DataSource) { lista.Add( new { id_menu = n.id_menu, men_nombre = n.men_nombre, id_menupadre = n.id_menupadre, men_url = n.men_url, men_opciones = n.men_opciones, men_ancho = n.men_ancho, men_alto = n.men_alto, men_orden = n.men_orden, men_activo = n.men_activo, men_nombreventana = n.men_nombreventana, }); } st_grilla.DataSource = lista; st_grilla.PageSize = limit; PageProxy pageProxy = st_grilla.Proxy[0] as PageProxy; if (pageProxy != null) pageProxy.Total = data.Registros; st_grilla.DataBind(); } catch (Exception ex) { Mensajes.Error(ex.Message); } }
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); } }
protected void strOpciones_OnReadData(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; btnAsociar.Disabled = false; btnDesasociar.Disabled = false; co_ca_perfilesopciones_no Nomina = new co_ca_perfilesopciones_no(); Nomina.Pagina = page; Nomina.RegistrosPorPaginas = limit; Nomina.ColumnaOrden = e.Sort[0].Property; Nomina.OrdenColumna = (FwpServerControls.FwpDataGridDataBound.Orden) Enum.Parse(typeof(FwpServerControls.FwpDataGridDataBound.Orden), e.Sort[0].Direction.ToString(), true); Nomina.id_perfil = e.Parameters.GetParameter("id_perfil").Value.ValidaEntero("id_perfil"); IList<object> lista = new List<object>(); AgregarFiltrosOpciones(ref Nomina); Nomina<co_ca_perfilesopciones_no> data = new bf_ca_perfilesopciones().GetNomina(Nomina); foreach (co_ca_perfilesopciones_no no in data.DataSource) { lista.Add(new { id_perfilopcion = no.id_perfilopcion, id_perfil = no.id_perfil, pe_perfil = no.pe_perfil, id_opcion = no.id_opcion, op_opcion = no.op_opcion, op_constante = no.op_constante, }); } strOpciones.DataSource = lista; strOpciones.PageSize = limit; PageProxy pageProxy = strOpciones.Proxy[0] as PageProxy; if (pageProxy != null) pageProxy.Total = data.Registros; strOpciones.DataBind(); } catch (Exception) { Mensajes.Error(ErrorText.ERROR_LIST_OPCIONES); } }
public void OnRefreshData_st_grilla(object sender, StoreReadDataEventArgs e) { 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_ca_menu_no Nomina = new co_ca_menu_no(); Nomina.Pagina = page; Nomina.RegistrosPorPaginas = e.Limit; Nomina.ColumnaOrden = e.Sort[0].Property; Nomina.OrdenColumna = (FwpDataGridDataBound.Orden) Enum.Parse(typeof(FwpDataGridDataBound.Orden), e.Sort[0].Direction.ToString(), true); IList<object> lista = new List<object>(); AgregarFiltros_st_grilla(ref Nomina); Nomina<co_ca_menu_no> data = new bf_ca_menu().GetNomina(Nomina); foreach (co_ca_menu_no n in data.DataSource) { lista.Add( new { id_menu = n.id_menu, id_menupadre = n.id_menupadre, men_nombre = n.men_nombre, men_url = n.men_url, id_tipoventana = n.id_tipoventana, id_opcion = n.id_opcion, op_opcion = n.op_opcion, id_sistema = n.id_sistema, men_opciones = n.men_opciones, men_ancho = n.men_ancho, men_alto = n.men_alto, men_orden = n.men_orden, men_activo = n.men_activo, men_nombreventana = n.men_nombreventana, }); } st_grilla.DataSource = lista; (st_grilla.Proxy[0] as PageProxy).Total = data.Registros; st_grilla.DataBind(); }
protected void strTablas_OnReadData(object sender, StoreReadDataEventArgs e) { try { IList<co_tg_tablas> listTablas = new bf_tg_tablas().GetData(new co_tg_tablas { ta_activo = TiposBases.EstadoRegistro.ACT, ta_esAtributo = TiposBases.EstadoRegistro.ACT }); if (listTablas.Any()) { strTablas.DataSource = listTablas; strTablas.DataBind(); } } catch (Exception ex) { Mensajes.Error(ex.Message); } }
protected void strGrdConstantes_OnReadData(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_constantes_no nomina = new co_tg_constantes_no(); nomina.Pagina = page; nomina.RegistrosPorPaginas = limit; nomina.ColumnaOrden = e.Sort[0].Property; nomina.OrdenColumna = (FwpDataGridDataBound.Orden) Enum.Parse(typeof (FwpDataGridDataBound.Orden), e.Sort[0].Direction.ToString(), true); IList<object> lista = new List<object>(); AgregarFiltros(ref nomina); Nomina<co_tg_constantes_no> data = new bf_tg_constantes().GetNomina(nomina); foreach (co_tg_constantes_no n in data.DataSource) { lista.Add(new { id_constante = n.id_constante, ct_constante = n.ct_constante, ct_constanteValor=n.ct_constanteValor, ct_constanteDescripcion =n.ct_constanteDescripcion, id_constantetipo = n.id_constantetipo, ct_constantetipo = n.ct_constantetipo }); } strGrdConstantes.DataSource = lista; strGrdConstantes.PageSize = limit; PageProxy pageSize = strGrdConstantes.Proxy[0] as PageProxy; if (pageSize != null) pageSize.Total = data.Registros; strGrdConstantes.DataBind(); } catch (Exception ex) { Mensajes.Error(ex.Message); } }
protected void strFamilia_OnReadData(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_re_familias_no Nomina = new co_re_familias_no(); Nomina.Pagina = page; Nomina.RegistrosPorPaginas = limit; Nomina.ColumnaOrden = e.Sort[0].Property; Nomina.OrdenColumna = (FwpServerControls.FwpDataGridDataBound.Orden)Enum.Parse(typeof(FwpServerControls.FwpDataGridDataBound.Orden), e.Sort[0].Direction.ToString(), true); AplicarFiltrosFamilia(ref Nomina); IList<object> lista = new List<object>(); Nomina<co_re_familias_no> data = new bf_re_familias().GetNomina(Nomina); foreach (co_re_familias_no item in data.DataSource) { lista.Add(new { id_familia = item.id_familia, fa_familia = item.fa_familia, fa_orden = item.fa_orden, fa_vigente = item.fa_vigente, id_rematetipo = item.id_rematetipo, re_rematetipo = item.re_rematetipo }); } strFamilia.DataSource = lista; strFamilia.PageSize = limit; PageProxy pageProxy = strFamilia.Proxy[0] as PageProxy; if (pageProxy != null) pageProxy.Total = data.Registros; strFamilia.DataBind(); } catch (Exception ex) { Mensajes.Error(ex.Message); } }
protected void strFamilia_ReadData(object sender, StoreReadDataEventArgs e) { try { int start = e.Start; int limit = e.Limit; int page = (start / limit) + 1; co_mv_mofamilias_no Nomina = new co_mv_mofamilias_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>(); AgregarFiltrosFamilia(Nomina); Nomina<co_mv_mofamilias_no> data = new bf_mv_mofamilias().GetNomina(Nomina); foreach (co_mv_mofamilias_no no in data.DataSource) { lista.Add(new { id_mofamilia = no.id_mofamilia, mofa_familia = no.mofa_familia, mofa_descripcion = no.mofa_descripcion, mofa_vigente = no.mofa_vigente, id_rematetipo = no.id_rematetipo.id, re_rematetipo = no.id_rematetipo.descripcion, }); } strFamilia.DataSource = lista; strFamilia.PageSize = limit; PageProxy pageProxy = strFamilia.Proxy[0] as PageProxy; if (pageProxy != null) pageProxy.Total = data.Registros; strFamilia.DataBind(); } catch (Exception ex) { Mensajes.Error(ErrorText.ERROR_CARGAR_FAMILIAS, "wf_fam_cat_sub_mobile.strFamilia_ReadData", ex); } }
private void _grid_ReadData(object sender, StoreReadDataEventArgs e) { var store = (Store)sender; var filterLinked = ConvertToFilterLinked(e, fc => { switch (fc.Field) { case "Name": return "roles.Name"; case "Privileges": return "privileges.Id"; } return null; }); var sort = ConvertToSort(e.Sort); int recordCount = 0; store.DataSource = privilege.GetRoles(e.Page, e.Limit, out recordCount, filterLinked, sort); store.DataBind(); e.Total = recordCount; }
void _grid_ReadData(object sender, StoreReadDataEventArgs e) { var filterLinked = ConvertToFilterLinked(e, fc => { switch (fc.Field) { case "Roles": return "roles.Id"; case "Status": return "users.Status"; } return null; }); var sort = ConvertToSort(e.Sort); int recordCount = 0; var store = sender as Store; store.DataSource = privilege.GetUsers(e.Page, e.Limit, out recordCount, filterLinked, sort); store.DataBind(); e.Total = recordCount; }
protected void LoadTemperatures(object sender, StoreReadDataEventArgs e) { var store = sender as Store; if (store == null) return; List<object> items = new List<object>(); Random rnd = new Random(); for (int i = 0; i < 20; i++) { var timeValue = 1327600670 + (3600 * i); items.Add(new { time = timeValue, yesterday = rnd.Next(20, 30), today = rnd.Next(15,25) }); } store.DataSource = items; store.DataBind(); }
protected void OnReadData_sColonias(object sender, StoreReadDataEventArgs e) { List<Colonia> lColonia = ColoniaBusiness.ObtenerColonias(); sColonias.DataSource = lColonia; sColonias.DataBind(); }
protected void strCmbIdPersona_OnReadData(object sender, StoreReadDataEventArgs e) { try { int start = e.Start; int limit = e.Limit; int page = (start / limit) + 1; co_tg_personas_no Nomina = new co_tg_personas_no(); Nomina.Pagina = page; Nomina.RegistrosPorPaginas = limit; Nomina.ColumnaOrden = e.Parameters.GetParameter("sort").Value; Nomina.OrdenColumna = (FwpServerControls.FwpDataGridDataBound.Orden) Enum.Parse(typeof(FwpServerControls.FwpDataGridDataBound.Orden), e.Parameters.GetParameter("dir").Value, true); if (!string.IsNullOrEmpty(strCmbFilterIdPersona.Text)) { Nomina.pe_nombrecompleto = strCmbFilterIdPersona.Text; } IList<object> lista = new List<object>(); Nomina<co_tg_personas_no> data = new bf_tg_personas().GetNomina(Nomina); foreach (co_tg_personas_no n in data.DataSource) { lista.Add( new { id_persona = n.id_persona, pe_nombrecompleto = n.pe_nombrecompleto, }); } strCmbIdPersona.DataSource = lista; PageProxy pageProxy = strCmbIdPersona.Proxy[0] as PageProxy; if (pageProxy != null) pageProxy.Total = data.Registros; strCmbIdPersona.DataBind(); strCmbFilterIdPersona.Text = ""; } catch (Exception) { Mensajes.Error(ErrorText.USUARIOS_NO_PERSONAS); } }
/// <summary> /// Evento que vuelve a leer los datos para ser cargados al store /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void OnReadData_sConceptos(object sender, StoreReadDataEventArgs e) { sConceptos.DataSource = ConceptoBusiness.ObtenerConceptos(); sConceptos.DataBind(); }
protected virtual void OnReadData(StoreReadDataEventArgs e) { AjaxReadDataEventHandler handler = (AjaxReadDataEventHandler)Events[EventReadData]; if (handler != null) { handler(this, e); } }
private void RaiseAjaxPostBackEvent(string eventArgument) { try { if (eventArgument.IsEmpty()) { throw new ArgumentNullException("eventArgument"); } string data = null; JToken parametersToken = null; if (this.DirectConfig != null) { parametersToken = this.DirectConfig.SelectToken("config.extraParams", false); JToken serviceToken = this.DirectConfig.SelectToken("config.serviceParams", false); if (serviceToken != null) { data = JSON.ToString(serviceToken); } } string action = eventArgument; BeforeDirectEventArgs e = new BeforeDirectEventArgs(action, data, parametersToken); this.OnAjaxPostBack(e); if (this.AutoDecode && data.IsNotEmpty()) { data = HttpUtility.HtmlDecode(data); } switch (action) { case "create": case "destroy": case "update": case "batch": if (data == null) { throw new InvalidOperationException("No data in request"); } this.DoSaving(action, data, parametersToken); break; case "read": StoreReadDataEventArgs refreshArgs = new StoreReadDataEventArgs(parametersToken); this.OnReadData(refreshArgs); PageProxy dsp = this.Proxy.Primary as PageProxy; if (dsp != null) { if (refreshArgs.Total > -1) { dsp.Total = refreshArgs.Total; } } break; case "submit": if (data == null) { throw new InvalidOperationException("No data in request"); } StoreSubmitDataEventArgs args = new StoreSubmitDataEventArgs(data, parametersToken); this.OnSubmitData(args); break; } } catch (Exception ex) { success = false; msg = this.IsDebugging ? ex.ToString() : ex.Message; if (this.ResourceManager.RethrowAjaxExceptions) { throw; } } AfterDirectEventArgs eAjaxPostBackResult = new AfterDirectEventArgs(new Response(success, msg)); this.OnAjaxPostBackResult(eAjaxPostBackResult); StoreResponseData response = new StoreResponseData(); if (eAjaxPostBackResult.Response.Success) { switch (eventArgument) { case "read": if (this.RequiresDataBinding) { this.DataBind(); } response.Data = this.GetAjaxDataJson(); PageProxy dsp = this.Proxy.Primary as PageProxy; response.Total = dsp != null ? dsp.Total : -1; break; case "create": case "destroy": case "update": response.Data = JSON.Serialize(this.responseRecords); break; } } eAjaxPostBackResult.Response.Data = response.ToString(); ResourceManager.ServiceResponse = eAjaxPostBackResult.Response; }
private void RaiseAjaxPostBackEvent(string eventArgument) { try { if (eventArgument.IsEmpty()) { throw new ArgumentNullException("eventArgument"); } string data = null; JToken parametersToken = null; if (this.DirectConfig != null) { parametersToken = this.DirectConfig.SelectToken("config.extraParams", false); JToken serviceToken = this.DirectConfig.SelectToken("config.serviceParams", false); if (serviceToken != null) { data = JSON.ToString(serviceToken); } } string action = eventArgument; BeforeDirectEventArgs e = new BeforeDirectEventArgs(action, data, parametersToken); this.OnAjaxPostBack(e); if (this.AutoDecode && data.IsNotEmpty()) { data = HttpUtility.HtmlDecode(data); } switch (action) { case "create": case "destroy": case "update": case "batch": if (data == null) { throw new InvalidOperationException("No data in request"); } this.DoSaving(action, data, parametersToken); break; case "read": StoreReadDataEventArgs refreshArgs = new StoreReadDataEventArgs(parametersToken); this.OnReadData(refreshArgs); PageProxy dsp = this.Proxy.Primary as PageProxy; if (dsp != null) { if (refreshArgs.Total > -1) { dsp.Total = refreshArgs.Total; } } break; case "submit": if (data == null) { throw new InvalidOperationException("No data in request"); } StoreSubmitDataEventArgs args = new StoreSubmitDataEventArgs(data, parametersToken); this.OnSubmitData(args); break; } } catch (Exception ex) { success = false; msg = this.IsDebugging ? ex.ToString() : ex.Message; if (this.ResourceManager.RethrowAjaxExceptions) { throw; } } AfterDirectEventArgs eAjaxPostBackResult = new AfterDirectEventArgs(new Response(success, msg)); this.OnAjaxPostBackResult(eAjaxPostBackResult); StoreResponseData response = new StoreResponseData(); if (eAjaxPostBackResult.Response.Success) { switch (eventArgument) { case "read": if (this.RequiresDataBinding) { this.DataBind(); } response.Data = this.GetAjaxDataJson(); PageProxy dsp = this.Proxy.Primary as PageProxy; response.Total = dsp != null ? dsp.Total : -1; break; case "create": case "destroy": case "update": response.Data = JSON.Serialize(this.responseRecords); break; } } eAjaxPostBackResult.Response.Data = response.ToString(); ResourceManager.ServiceResponse = eAjaxPostBackResult.Response; }
protected void StoreGPRacesForClubber_ReadData(object sender, StoreReadDataEventArgs e) { using (var db = new ClubSiteContext()) { Store store = this.GPRacesForClubber.GetStore(); var aMember = (from m in db.Members where m.UserName == memberUsed.UserName select m).FirstOrDefault(); if (aMember != null) { store.DataSource = from r in aMember.Races orderby r.RaceDate select new { RaceId = r.Id, r.Name, RDate = r.RaceDate, SportName = r.RaceType.Sport.Name, RaceTypeName = r.RaceType.Name }; store.DataBind(); } } }
protected void StoreCbRaces_ReadData(object sender, StoreReadDataEventArgs e) { using (var db = new ClubSiteContext()) { DateTime fromDate = dtfFromDate.SelectedDate; DateTime toDate = dtfToDate.SelectedDate; Store store = this.cbRaces.GetStore(); store.DataSource = from r in db.Races join rt in db.RaceTypes on r.RaceTypeID equals rt.RaceTypeID join s in db.Sports on rt.SportID equals s.SportID where r.RaceDate >= fromDate && r.RaceDate <= toDate orderby s.Name, rt.Name, r.Name select new { RaceId = r.Id, Name = r.Name + " (" + s.Name + " " + rt.Name + ")" }; store.DataBind(); } }
protected void StoreGPClubbersEnComp_ReadData(object sender, StoreReadDataEventArgs e) { using (var db = new ClubSiteContext()) { Store store = this.GPClubbersEnComp.GetStore(); var aRace = (from r in db.Races where r.Id == rUsed.Id select r).FirstOrDefault(); store.DataSource = aRace.Members; store.DataBind(); } }
protected void StoreGPAgeGroupsEnComp_ReadData(object sender, StoreReadDataEventArgs e) { using (var db = new ClubSiteContext()) { //Load data for Age Groups in Race Store storeAgeGroups = this.GPAgeGroupsEnComp.GetStore(); if (rUsed.Id != 0) { var aRace = (from r in db.Races where r.Id == rUsed.Id select r).FirstOrDefault(); storeAgeGroups.DataSource = aRace.RaceAgeGroups; } else { storeAgeGroups.DataSource = new List<RaceAgeGroup>(); } storeAgeGroups.DataBind(); } }
protected void dgridKitapListesi_ReadData(object sender, Ext.Net.StoreReadDataEventArgs e) { this.dgridKitapListesi.DataBind(); }