コード例 #1
0
        private void CargarFltDataAlarma()
        {
            List <string> tipos  = new List <string>();
            List <string> categs = new List <string>();
            List <string> vehs   = new List <string>();

            foreach (var item in cboFltTipos.CheckedItems)
            {
                tipos.Add(item.Value);
            }

            foreach (var item in cboFltCategorias.CheckedItems)
            {
                categs.Add(item.Value);
            }

            foreach (var item in cboFltVehiculos.CheckedItems)
            {
                vehs.Add(item.Value);
            }

            if (tipos.Count == 0)
            {
                foreach (var item in cboFltTipos.Items.ToList())
                {
                    item.Checked = true;
                    tipos.Add(item.Value);
                }
            }

            if (categs.Count == 0)
            {
                foreach (var item in cboFltCategorias.Items.ToList())
                {
                    item.Checked = true;
                    categs.Add(item.Value);
                }
            }

            if (vehs.Count == 0)
            {
                foreach (var item in cboFltVehiculos.Items.ToList())
                {
                    item.Checked = true;
                    vehs.Add(item.Value);
                }
            }

            var    txtfechaini = Request["datepicker1"].ToString();
            var    txtfechafin = Request["datepicker2"].ToString();
            string fechaI      = txtfechaini;
            string horaI       = cbohorai.Text;

            string fechaF = txtfechafin;
            string horaF  = cbohoraf.Text;

            if (!User.IsInRole("SA") || SitePrincipal.ExisteActiva())
            {
                userName = User.Identity.Name;
                nit      = homeCtrl.obtenerNit(userName);

                rptAlarmas = reporteCtrl.GetFltRptAlarmas(tipos, categs, vehs, nit, fechaI, horaI, fechaF, horaF, sortExpresion, sortDireccion);
            }
            else
            {
                rptAlarmas = reporteCtrl.GetFltSARptAlarmas(tipos, categs, vehs, fechaI, horaI, fechaF, horaF, sortExpresion, sortDireccion);
            }
        }