コード例 #1
0
 protected void txtPlaza_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ValidarObjeto(txtPlaza.SelectedValue))
     {
         try
         {
             Repeticion.DataSource = controlAccesoDao.GetListado(true, plazaDao.GetById(Int32.Parse(txtPlaza.SelectedValue)), DbDao.ControlAccesoDao.Ordenamiento.Nombre);
             Repeticion.DataBind();
         }
         catch (Exception ex)
         {
             log.Error(String.Format("Error al intentar obtener el listado de Controles de Acceso para la Plaza: [{0}]. Mensaje: [{1}]", txtPlaza.SelectedValue, ex.Message));
             ManejarExcepcion(ex);
         }
     }
 }
コード例 #2
0
        protected void BtnActualizar_Click(object sender, EventArgs e)
        {
            if (!ValidarObjeto(txtFecha.Text) || !ValidarObjeto(txtFechaFin.Text))
            {
                MostrarExcepcion("Campo Requerido", "Es requerido seleccionar las dos fechas del reporte");
            }
            log.Info(String.Format("El usuario: [{0}] ha generado el reporte de Asistencia con Fecha Inicial: [{1}] y Fecha Final: [{2}]", UsuarioActual.Nombre, txtFecha.Text, txtFechaFin.Text));

            Plaza plaza = null;

            if (ValidarObjeto(txtPlaza.SelectedValue))
            {
                plaza = plazaDao.GetById(Int32.Parse(txtPlaza.SelectedValue));
            }


            List <Incidencia> l = incidenciaDao.GetListado(plaza, DateTime.Parse(txtFecha.Text), DateTime.Parse(txtFechaFin.Text).AddDays(1));

            if (l == null || l.Count == 0)
            {
                MostrarNotificacion("Lista Vacia", "El reporte no contiene datos en las fechas solicitadas");
            }
            GenerarExcel(l);
        }
コード例 #3
0
        protected void txtPlaza_SelectedIndexChanged(object sender, EventArgs e)
        {
            Repeticion.DataSource = new List <Plantilla>();
            Repeticion.DataBind();


            if (ValidarObjeto(txtPlaza.SelectedValue))
            {
                txtControlAcceso.Items.Clear();
                txtControlAcceso.Items.Add(NuevoListItem(Constantes.TEXTO_SELECCION, Constantes.TEXTO_BLANCO));
                try
                {
                    List <ControlAcceso> controles = controlAccesoDao.GetListado(true, plazaDao.GetById(Int32.Parse(txtPlaza.SelectedValue)), DbDao.ControlAccesoDao.Ordenamiento.Nombre);
                    if (controles != null && controles.Count > 0)
                    {
                        foreach (ControlAcceso ctrl in controles)
                        {
                            txtControlAcceso.Items.Add(NuevoListItem(ctrl.Nombre, ctrl.CveControlAcceso.ToString()));
                        }
                    }

                    CargarDatos();
                }
                catch (Exception ex)
                {
                    log.Error(String.Format("Error en el Proceso Obtener Lista de Controles de Acceso para la Plaza [{0}]. Mensaje: [{1}]", txtPlaza.SelectedValue, ex.Message));
                    ManejarExcepcion(ex);
                }
            }
        }
コード例 #4
0
        protected void txtPlaza_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Limpiamos la lista de plantilla
            Repeticion.DataSource = new List <Plantilla>();
            Repeticion.DataBind();


            if (ValidarObjeto(txtPlaza.SelectedValue))
            {
                // Limpiamos el dropdown de plantillas
                txtPlantilla.Items.Clear();
                txtPlantilla.Items.Add(NuevoListItem(Constantes.TEXTO_SELECCION, Constantes.TEXTO_BLANCO));
                try
                {
                    // Obtenemos la lista de controles de acceso de esta plaza
                    List <ControlAcceso> listaControles = controlAccesoDao.GetListado(true, plazaDao.GetById(Int32.Parse(txtPlaza.SelectedValue)), DbDao.ControlAccesoDao.Ordenamiento.Nombre);

                    // Obtenemos el grupo de plantillas que corresponden al grupo de controles
                    List <GrupoPlantilla> plantillas = plantillaDao.GetGrupo(listaControles);

                    if (plantillas != null && plantillas.Count > 0)
                    {
                        foreach (GrupoPlantilla obj in plantillas)
                        {
                            txtPlantilla.Items.Add(NuevoListItem(String.Format("Control: [{0}], Ip: [{1}], Empleados: [{2} ]", obj.Control.Nombre, obj.Control.DireccionIp, obj.Conteo), obj.Control.CveControlAcceso.ToString()));
                        }
                    }
                }
                catch (Exception ex)
                {
                    log.Error(String.Format("Error en el Proceso Obtener Plantillas para la Plaza [{0}]. Mensaje: [{1}]", txtPlaza.SelectedValue, ex.Message));
                    ManejarExcepcion(ex);
                }
            }
        }