Exemple #1
0
 protected void rdcFiltro_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
 {
     RadFilter1.RootGroup.Expressions.Clear();
     RadFilter1.RecreateControl();
     txtFiltro.Text = "";
     if (rdcFiltro.SelectedValue != "")
     {
         Filtro f = CntLainsaSci.GetFiltro(int.Parse(rdcFiltro.SelectedValue), ctx);
         txtFiltro.Text = f.Nombre;
         RadFilter1.LoadSettings(f.Expresion);
     }
     RadFilter1.FireApplyCommand();
 }
 protected void btnEliminar_Click(object sender, EventArgs e)
 {
     if (txtFiltro.Text != "")
     {
         Filtro f = CntLainsaSci.GetFiltro("Incidencia", txtFiltro.Text, usuario, ctx);
         if (f != null)
         {
             string nom = f.Nombre;
             ctx.Delete(f);
             ctx.SaveChanges();
             CargarFiltros(null);
             rdcFiltro.SelectedValue = "";
             RadNotification1.Text   = String.Format("El filtro '{0}' ha sido eliminado", nom);
             RadNotification1.Show();
         }
     }
 }
Exemple #3
0
 protected void btnAgregar_Click(object sender, EventArgs e)
 {
     if (txtFiltro.Text != "")
     {
         Filtro f = CntLainsaSci.GetFiltro("Dispositivo", txtFiltro.Text, ctx);
         if (f == null)
         {
             f = new Filtro();
             ctx.Add(f);
         }
         f.Tipo      = "Dispositivo";
         f.Nombre    = txtFiltro.Text;
         f.Expresion = RadFilter1.SaveSettings();
         ctx.SaveChanges();
         CargarFiltros(f);
         rdcFiltro.SelectedValue = f.FiltroId.ToString();
         RadNotification1.Text   = String.Format("El filtro '{0}' ha sido agregado, lo puede ver en el desplegable", f.Nombre);
         RadNotification1.Show();
     }
 }