Exemplo n.º 1
0
 private void FILTRO_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     using (var CTX = new LiderEntities())
     {
         Filtros.frmFiltros         filtro = new Filtros.frmFiltros();
         DataGridViewComboBoxColumn i      = filtro.dataGridView1.Columns["Index1"] as DataGridViewComboBoxColumn;
         i.DataSource    = CTX.FiltroConfiguracions.Where(a => a.Tipo == "CONDICION").ToArray();
         i.DisplayMember = "Descripcion";
         i.ValueMember   = "Codigo";
         DataGridViewComboBoxColumn j = filtro.dataGridView1.Columns["Index3"] as DataGridViewComboBoxColumn;
         j.DataSource    = CTX.FiltroConfiguracions.Where(a => a.Tipo == "OPERADOR").ToList();
         j.DisplayMember = "Descripcion";
         j.ValueMember   = "Codigo";
         DataGridViewComboBoxColumn k = filtro.dataGridView1.Columns["Index0"] as DataGridViewComboBoxColumn;
         k.DataSource         = CTX.Database.SqlQuery <string>(Libreria.Constante.Mapa_Table + "'" + Tabla + "'").ToList();
         filtro.pasar        += new Filtros.frmFiltros.variables(condicion);
         filtro.StartPosition = FormStartPosition.CenterScreen;
         foreach (var fila in CTX.Filtroes.Where(w => w.tabla.Equals(Tabla)).ToList())
         {
             filtro.dataGridView1.Rows.Add(fila.campo, fila.condicion, fila.valor, fila.union);
         }
         filtro.entidad = Tabla;
         filtro.ShowDialog();
     }
 }
Exemplo n.º 2
0
 private void FILTRO_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     using (var CTX = new LiderEntities())
     {
         var Rutina = new Libreria.Rutina();
         Rutina.actualizar("pedido", "FECHA = REPLACE(CONVERT(VARCHAR(10),Fecha,120),'-','')", "procesado = 0 and statusweb is null");
         Rutina.ejecutar(Libreria.Constante.PedidoRecalculo);
         Filtros.frmFiltros         filtro = new Filtros.frmFiltros();
         DataGridViewComboBoxColumn i      = filtro.dataGridView1.Columns["Index1"] as DataGridViewComboBoxColumn;
         i.DataSource    = CTX.FiltroConfiguracions.Where(a => a.Tipo == "CONDICION").ToArray();
         i.DisplayMember = "Descripcion";
         i.ValueMember   = "Codigo";
         DataGridViewComboBoxColumn j = filtro.dataGridView1.Columns["Index3"] as DataGridViewComboBoxColumn;
         j.DataSource    = CTX.FiltroConfiguracions.Where(a => a.Tipo == "OPERADOR").ToList();
         j.DisplayMember = "Descripcion";
         j.ValueMember   = "Codigo";
         DataGridViewComboBoxColumn k = filtro.dataGridView1.Columns["Index0"] as DataGridViewComboBoxColumn;
         k.DataSource         = CTX.Database.SqlQuery <string>(Libreria.Constante.Mapa_View + "'vva_pedido'").ToList();
         filtro.pasar        += new Filtros.frmFiltros.variables(Condicion);
         filtro.StartPosition = FormStartPosition.CenterScreen;
         foreach (var fila in CTX.Filtroes.Where(w => w.tabla.Equals(Tabla)).OrderBy(x => x.Orden).ToList())
         {
             filtro.dataGridView1.Rows.Add(fila.campo, fila.condicion, fila.valor, fila.union);
         }
         filtro.entidad = Tabla;
         filtro.ShowDialog();
     }
 }