public void GuardarNotificaciones(D_COD_ESTADO_NOTIFICACION estadoNotif)
        {
            string codPersonas = string.Empty;

            _agentesInvolucrados.Add(_cndc);
            foreach (var a in _agentesInvolucrados)
            {
                Notificacion n = new Notificacion();
                n.PkCodFalla   = _regFalla.CodFalla;
                n.PkCodPersona = a.PkCodPersona;
                n.DCodEstado   = "1";
                n.EsNuevo      = !ModeloMgr.Instancia.NotificacionMgr.Existe(_regFalla.CodFalla, a.PkCodPersona);

                n.DCodEstadoNotificacion = (long)estadoNotif;
                if (n.EsNuevo || estadoNotif != D_COD_ESTADO_NOTIFICACION.REGISTRADO)
                {
                    ModeloMgr.Instancia.NotificacionMgr.Guardar(n);
                }

                codPersonas += a.PkCodPersona + ",";
            }

            if (codPersonas != string.Empty)
            {
                codPersonas = string.Format("({0})", codPersonas.Substring(0, codPersonas.Length - 1));
                ModeloMgr.Instancia.NotificacionMgr.BorrarNotificacionesIncorrectas(_regFalla.CodFalla, codPersonas);
            }
            _agentesInvolucrados.Remove(_cndc);
        }
Beispiel #2
0
        public Notificacion <List <Usuario> > ObtenerUsuarios(Usuario usr)
        {
            Notificacion <List <Usuario> > notificacion = new Notificacion <List <Usuario> >();

            try
            {
                using (db = new SqlConnection(ConfigurationManager.AppSettings["conexionString"].ToString()))
                {
                    var parameters = new DynamicParameters();
                    parameters.Add("@idUsuario", usr.idUsuario == 0 ? (object)null : usr.idUsuario);
                    var result = db.QueryMultiple("SP_OBTENER_USUARIOS ", parameters, commandType: CommandType.StoredProcedure);
                    var r1     = result.ReadFirst();
                    if (r1.Estatus == 200)
                    {
                        notificacion.Estatus = r1.Estatus;
                        notificacion.Mensaje = r1.Mensaje;
                        notificacion.Modelo  = result.Read <Usuario, Rol, Usuario>(MapUsuario, splitOn: "idRol").ToList();
                    }
                    else
                    {
                        notificacion.Estatus = r1.Estatus;
                        notificacion.Mensaje = r1.Mensaje;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(notificacion);
        }
        protected void btn_SolicitudJugador_Click(object sender, EventArgs e)
        {
            // SOLICITUD POR JUGADOR

            int jugador = 0;

            int.TryParse(cmb_Jugadores.SelectedItem.Value, out jugador);

            Notificacion notificacion = new Notificacion();

            notificacion.idEmisor       = int.Parse(Session["ID"].ToString());
            notificacion.nombreEmisor   = Session["Usuario"].ToString();
            notificacion.idReceptor     = jugador;
            notificacion.nombreReceptor = cmb_Jugadores.SelectedItem.Text;
            notificacion.idEncuentro    = 0; // 0 = Solicitud

            notificacion.texto = "Nuevo Contacto";


            notificacion.idEstado = 10; //(No Check)
            NotificacionDao.insertarNotificacion(notificacion);

            lbl_ResultadosBusqueda.Text = "La solicitud ha sido enviada";

            alertaNotificacion.Visible = true;
        }
Beispiel #4
0
        public bool Registrar(FormularioRegistrarNotificacion formulario)
        {
            try
            {
                Notificacion           notificacion = formulario.Notificacion;
                IEnumerable <Segmento> segmentos    = formulario.Segmentos;

                notificacion.FechaInicio = DateTime.Now;

                if (repositorio.Insertar(notificacion))
                {
                    RepositorioSegmento repoSegmento = new RepositorioSegmento();
                    RepositorioCargo    repoCargo    = new RepositorioCargo();

                    int id = repositorio.PorUltimoId();

                    foreach (Segmento segmento in segmentos)
                    {
                        segmento.Notificacion = id;

                        if (repoCargo.PorId(segmento.Cargo) is Cargo cargo)
                        {
                            repoSegmento.Insertar(segmento);
                        }
                    }
                    return(true);
                }
                return(false);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                return(false);
            }
        }
Beispiel #5
0
        public Notificacion <Acuerdo> EliminarAcuerdo(Acuerdo acuerdo)
        {
            Notificacion <Acuerdo> n = null;

            try
            {
                using (db = new DBManager(ConfigurationManager.AppSettings["conexionString"].ToString()))
                {
                    db.Open();
                    db.CreateParameters(2);
                    db.AddParameters(0, "@idAcuerdo", acuerdo.IdAcuerdo);
                    db.AddParameters(1, "@idAsamblea", acuerdo.IdAsamblea);
                    db.ExecuteReader(System.Data.CommandType.StoredProcedure, "SP_ELIMINAR_ACUERDO");
                    if (db.DataReader.Read())
                    {
                        if (Convert.ToInt32(db.DataReader["estatus"].ToString()) == 200)
                        {
                            n            = new Notificacion <Acuerdo>();
                            n.Estatus    = Convert.ToInt32(db.DataReader["estatus"]);
                            n.Mensaje    = db.DataReader["mensaje"].ToString();
                            n.TipoAlerta = "success";
                            n.Model      = acuerdo;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(n);
        }
Beispiel #6
0
        protected void btnGuardarAcronimo_OnClick(object sender, EventArgs e)
        {
            try
            {
                // Validamos
                if (!ValidarAcronimos())
                {
                    return;
                }

                // Seteamos
                _acronimo.ProyectoModelo      = txtProyectoModelo.Text;
                _acronimo.AcronimoModelo      = txtAcronimoModelo.Text;
                _acronimo.ProyectoControlador = txtProyectoControlador.Text;
                _acronimo.AcronimoControlador = txtAcronimoControlador.Text;
                _acronimo.ProyectoContenedor  = txtProyectoContenedor.Text;

                // Guardamos
                Acronimo.Escribir(_acronimo);

                // Libre de pecados
                Notificacion.Success(this, $"Se ha guardado el acrónimo");
            }
            catch (Exception ex)
            {
                Notificacion.Success(this, $"Ha ocurrido un error; {ex.Message}");
            }
        }
Beispiel #7
0
        protected void btnBdGenerar_OnClick(object sender, EventArgs e)
        {
            try
            {
                // Validamos que este buena la conexión
                _sql = Sql.Leer();

                // Validamos si conecta
                if (!_sql.ProbarConexion(_sql))
                {
                    Notificacion.Success(this, $"No se ha podido establecer una conexión con la BD");
                    return;
                }

                // Existe la tabla mencionada?
                //if (!_sql.ExisteTabla(_sql, ddlBdTablas.SelectedValue))
                //{
                //    Notificacion.Success(this, $"No exista la tabla {ddlBdTablas.SelectedValue}");
                //    return;
                //}

                // Generamos la consulta
                DataTable dataTable = _sql.Select_Campos(_sql, ddlBdTablas.SelectedValue);

                // Le mostramos eso al grid
                GridView1.DataSource = dataTable;
                GridView1.DataBind();

                btngenerarClases_OnClick(null, null);
            }
            catch (Exception ex)
            {
                Notificacion.Success(this, $"Ha ocurrido un error; {ex.Message}");
            }
        }
 //Generar reporte (factura de pedido de servicio)(S)
 public Notificacion generarFactura(Notificacion notificacion, int idCliente)
 {
     using (var db = new MapeoCliente())
     {
         return((from n in db.notificacion
                 join cl in db.client on n.IdCliente equals cl.IdCliente
                 join d in db.destino on n.IdDestino equals d.Id
                 join u in db.destino on n.IdUbicacion equals u.Id
                 join p in db.pago on n.Pago equals p.Id
                 orderby n.Id
                 select new
         {
             n,
             cl.Nombrecl,
             d.LugarDestino,
             u.LugarUbicacion,
             p.Descripcion
         }).ToList().Select(m => new Notificacion
         {
             Id = m.n.Id,
             IdCliente = m.n.IdCliente,
             IdDestino = m.n.IdDestino,
             IdUbicacion = m.n.IdUbicacion,
             Tarifa = m.n.Tarifa,
             FechaCarrera = m.n.FechaCarrera,
             Pago = m.n.Pago,
             NombreCl = m.Nombrecl,
             Destino = m.LugarDestino,
             Ubicacion = m.LugarUbicacion,
             MetodoPago = m.Descripcion
         }).Where(x => x.IdCliente == idCliente).Last());
     }
 }
Beispiel #9
0
        public async Task <IActionResult> Asignar([FromBody] DeptoArticulo da)
        {
            if (!ConexionOracle.Activa)
            {
                ConexionOracle.Open();
                if (!ConexionOracle.Activa)
                {
                    return(StatusCode(504, ConexionOracle.NoConResponse));
                }
            }
            if (await cmd.Insert(da, false))
            {
                var d = await cmd.Get <Departamento>(da.Id_depto);

                var l = await cmd.Get <Localidad>(d.Id_localidad);

                var lu = await cmd.Get <LocalidadUsuario>(l.Id_localidad);

                var a = await cmd.Get <Articulo>(da.Id_articulo);

                Notificacion n = new Notificacion();
                n.Username  = lu.Username;
                n.Fecha     = DateTime.Now;
                n.Titulo    = "Asignación de artículo a departamento";
                n.Contenido = "Se ha asignado el articulo \"" + a.Nombre + "\"(ID:" + a.Id_articulo + ") al departamento \"" + d.Nombre + "\"."
                              + "\n\nEl artículo debe ser dispuesto en el departamento a la brevedad.";
                n.Visto = '0';
                await cmd.Insert(n);

                return(Ok());
            }
            return(BadRequest());
        }
Beispiel #10
0
        /// <summary>
        /// Metodo que elimina el registro de la base de datos que determina si el usuario quiere notificaciones por correo
        /// </summary>
        /// <param name="objeto">Con el Id del usuario al que se desea eliminar el registro</param>
        /// <returns>true si elimina existosamente, false en caso de error</returns>
        public override void Eliminar(Entidad objeto)
        {
            Notificacion notificacion = (Notificacion)objeto;

            try
            {
                base.Conectar();
                comando             = new NpgsqlCommand("eliminar_notificacion", base.SqlConexion);
                comando.CommandType = CommandType.StoredProcedure;
                comando.Parameters.AddWithValue(NpgsqlTypes.NpgsqlDbType.Integer, notificacion.IdUsuario);
                respuesta = comando.ExecuteReader();
                respuesta.Read();
                Boolean resp = respuesta.GetBoolean(0);
                base.Desconectar();
            }
            catch (NpgsqlException e)
            {
                base.Desconectar();
                throw e;
            }
            catch (Exception e)
            {
                base.Desconectar();
                throw e;
            }
        }
Beispiel #11
0
        /// <summary>
        /// Metodo que modifica si el registro de notificaciones por correo  de la base de datos
        /// </summary>
        /// <param name="id_usuario">Id del usuario al que se desea modificar las notificaciones</param>
        /// <param name="correo">Variable que determina si se desea recibir o no, notificaciones por correo</param>
        /// <returns>True si modifica existosamente, false en caso de error</returns>
        public override void Actualizar(Entidad objeto)
        {
            Notificacion notificacion = (Notificacion)objeto;

            try
            {
                base.Conectar();
                comando             = new NpgsqlCommand("modificar_notificacion", base.SqlConexion);
                comando.CommandType = CommandType.StoredProcedure;
                comando.Parameters.AddWithValue(NpgsqlTypes.NpgsqlDbType.Integer, notificacion.IdUsuario);
                comando.Parameters.AddWithValue(NpgsqlTypes.NpgsqlDbType.Boolean, notificacion.Correo);
                //La siguiente linea determina si se desea recibir notificaciones push, en caso de implementarlo.
                comando.Parameters.AddWithValue(NpgsqlTypes.NpgsqlDbType.Boolean, notificacion.Push);
                respuesta = comando.ExecuteReader();
                base.Desconectar();
            }
            catch (NpgsqlException e)
            {
                base.Desconectar();
                throw e;
            }
            catch (InvalidCastException e)
            {
                base.Desconectar();
                throw e;
            }
            catch (Exception e)
            {
                base.Desconectar();
                throw e;
            }
        }
Beispiel #12
0
        public Notificacion <T> Modificar(T entidad)
        {
            Notificacion <T> retorno = new Notificacion <T>();

            retorno.Respuesta = entidad;
            string nombreEntidad = typeof(T).Name.Replace("TO", string.Empty);

            try
            {
                Notificacion <bool> respuestaExiste = Existe(entidad);

                if (respuestaExiste.HayError || respuestaExiste.HayExcepcion)
                {
                    retorno.Unir(respuestaExiste);
                    return(retorno);
                }

                if (respuestaExiste.Respuesta)
                {
                    DAO.Modificar(entidad);
                    retorno.AgregarMensaje(nombreEntidad, "Modificar_OK");
                }
                else
                {
                    retorno.AgregarMensaje(nombreEntidad, "Error_No_Existe");
                }
            }
            catch (Exception ex)
            {
                retorno.AgregarMensaje(nombreEntidad, "Modificar_Error", null, null, null, null, ex);
            }

            return(retorno);
        }
Beispiel #13
0
 public NotificacionDTO(Notificacion item)
 {
     Id          = item.Id;
     Mensaje     = item.Mensaje;
     Readed      = item.Readed;
     DateCreated = item.DateCreated;
 }
Beispiel #14
0
        public Notificacion <Usuario> ValidarUsario(Sesion sesion)
        {
            Notificacion <Usuario> n = null;

            try
            {
                using (db = new DBManager(ConfigurationManager.AppSettings["conexionString"].ToString()))
                {
                    db.Open();
                    db.CreateParameters(2);
                    db.AddParameters(0, "@usuario", sesion.Usuario);
                    db.AddParameters(1, "@contrasena", sesion.Contrasena);
                    db.ExecuteReader(System.Data.CommandType.StoredProcedure, "SP_VALIDAR_USUARIO");
                    if (db.DataReader.Read())
                    {
                        if (Convert.ToInt32(db.DataReader["estatus"].ToString()) == 200)
                        {
                            n            = new Notificacion <Usuario>();
                            n.Estatus    = Convert.ToInt32(db.DataReader["estatus"]);
                            n.Mensaje    = db.DataReader["mensaje"].ToString();
                            n.TipoAlerta = "success";
                            //n.Model = sesion;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(n);
        }
        /// <summary>
        /// Valida los valores principales del objeto.
        /// </summary>
        /// <remarks>
        ///     Registro de versiones:
        ///
        ///         1.0 15/06/2016 Marcos Abraham Hernández Bravo (Ada Ltda.): versión inicial.
        /// </remarks>
        /// <returns>
        ///     Retorna <code>true</code> en caso de ser válido, o <code>false</code> de lo contrario.
        /// </returns>
        public virtual Notificacion <bool> Validar()
        {
            Notificacion <bool> retorno = new Notificacion <bool>();

            retorno.Respuesta = true;

            if (string.IsNullOrEmpty(Tabla))
            {
                retorno.AgregarMensaje(Notificacion.TABLA_POR_DEFECTO_MENSAJES, "ERROR_VACIO", "Tabla");
                retorno.Respuesta = false;
            }

            if (string.IsNullOrEmpty(Codigo))
            {
                retorno.AgregarMensaje(Notificacion.TABLA_POR_DEFECTO_MENSAJES, "ERROR_VACIO", "Codigo");
                retorno.Respuesta = false;
            }

            if (string.IsNullOrEmpty(Idioma))
            {
                retorno.AgregarMensaje(Notificacion.TABLA_POR_DEFECTO_MENSAJES, "ERROR_VACIO", "Idioma");
                retorno.Respuesta = false;
            }

            if (string.IsNullOrEmpty(Pais))
            {
                retorno.AgregarMensaje(Notificacion.TABLA_POR_DEFECTO_MENSAJES, "ERROR_VACIO", "Pais");
                retorno.Respuesta = false;
            }

            return(retorno);
        }
        /// <summary>
        /// Persiste los cambios de una entidad.
        /// </summary>
        /// <remarks>
        ///     Registro de versiones:
        ///
        ///         1.0 02/08/2016 Marcos Abraham Hernández Bravo (Ada Ltda.): versión inicial.
        /// </remarks>
        /// <param name="entidad">Mensaje a persistir.</param>
        /// <returns>Mensaje persistido.</returns>
        public Notificacion <MensajeTO> Modificar(MensajeTO entidad)
        {
            Notificacion <MensajeTO> retorno = new Notificacion <MensajeTO>();

            retorno.Respuesta = entidad;
            try
            {
                Notificacion <bool> respuestaExiste = Existe(entidad);

                if (respuestaExiste.HayError || respuestaExiste.HayExcepcion)
                {
                    retorno.Unir(respuestaExiste);
                    return(retorno);
                }

                if (respuestaExiste.Respuesta)
                {
                    DAO.Modificar(entidad);
                    retorno.AgregarMensaje("Mensaje", "Modificar_OK");
                }
                else
                {
                    retorno.AgregarMensaje("Mensaje", "Error_No_Existe");
                }
            }
            catch (Exception ex)
            {
                retorno.AgregarMensaje("Mensaje", "Modificar_Error", null, null, null, null, ex);
            }

            return(retorno);
        }
Beispiel #17
0
        public Cascaron  getGanancia(string usuario)
        {
            Conductor conductor1  = new LConductor(_context).mostrarDatosLogin(usuario);
            int       idConductor = conductor1.IdConductor;

            try
            {
                Notificacion notificacion = new Notificacion();

                notificacion.IdConductor = idConductor;

                double   suma     = new LServicioConductor(_context).ganancia(notificacion);
                double   ganancia = suma * 0.25;
                Cascaron cascaron = new Cascaron();
                cascaron.Mensaje = ganancia.ToString();

                return(cascaron);
            }
            catch (Exception ex)
            {
                Cascaron cascaron = new Cascaron();
                cascaron.Mensaje = "No tiene ganancias";
                return(cascaron);
            }
        }
Beispiel #18
0
        public void CrearNotificacion(Notificacion notificacion)
        {
            string connectionString = AppSettings.GetConnectionString();

            using (SqlConnection sqlConnection = new SqlConnection(connectionString))
            {
                string sqlString = @"INSERT INTO Notificacion(usernameFK, fechaCreacion, mensaje, estado, url)
									 VALUES(@usernameFK, @fechaCreacion, @mensaje, @estado, @url)"                                    ;

                sqlConnection.Open();
                using (SqlCommand sqlCommand = new SqlCommand(sqlString, sqlConnection))
                {
                    sqlCommand.Parameters.AddWithValue("@usernameFK", notificacion.usernameFK);
                    sqlCommand.Parameters.AddWithValue("@fechaCreacion", notificacion.fechaCreacion);
                    sqlCommand.Parameters.AddWithValue("@mensaje", notificacion.mensaje);
                    sqlCommand.Parameters.AddWithValue("@estado", notificacion.estado);
                    if (notificacion.url != null)
                    {
                        sqlCommand.Parameters.AddWithValue("@url", notificacion.url);
                    }
                    else
                    {
                        sqlCommand.Parameters.AddWithValue("@url", DBNull.Value);
                    }

                    sqlCommand.ExecuteNonQuery();
                }
            }
        }
Beispiel #19
0
        protected void btnConectarse_OnClick(object sender, EventArgs e)
        {
            try
            {
                // Validamos la BD
                if (!ValidarBd())
                {
                    return;
                }

                // Guardamos los cambios
                Sql.Escribir(_sql);

                // Obtenemos las tablas
                DataTable dataTable = _sql.Select_Tables(_sql);
                ddlBdTablas.DataSource     = dataTable;
                ddlBdTablas.DataTextField  = "TABLE_NAME";
                ddlBdTablas.DataValueField = "TABLE_NAME";
                ddlBdTablas.DataBind();

                btnBdGenerar_OnClick(null, null);

                // Libre de pecados
                Notificacion.Success(this, "Se ha establecido la conexión con éxito");
            }
            catch (Exception ex)
            {
                Notificacion.Success(this, $"Ha ocurrido un error; {ex.Message}");
            }
        }
        //Lista de conductores para pago
        public List <Notificacion> conductoresPago()//S
        {
            using (var db = new MapeoConductor())
            {
                List <Notificacion> lista = (from n in db.notificacion
                                             join co in db.conduc on n.IdConductor equals co.IdConductor
                                             select new
                {
                    n,
                    co.Nombre
                }).ToList().Select(m => new Notificacion
                {
                    Id          = m.n.Id,
                    IdConductor = m.n.IdConductor,
                    NombreCo    = m.Nombre
                }).OrderBy(x => x.IdConductor).ToList();

                var conductores = lista.GroupBy(x => x.IdConductor).Select(grp => grp.ToList());

                List <Notificacion> listaCo = new List <Notificacion>();

                foreach (var item in conductores)
                {
                    Notificacion notificacion = new Notificacion();
                    notificacion.ListaConductores = item;
                    notificacion.IdConductor      = notificacion.ListaConductores.First().IdConductor;
                    notificacion.NombreCo         = notificacion.ListaConductores.First().NombreCo;
                    listaCo.Add(notificacion);
                }
                return(listaCo);
            }
        }
Beispiel #21
0
        public ActionResult IndexToExcel()
        {
            var _file = _service.IndexToExcel();

            if (ModelState.IsValid)
            {
                return(File(_file.FileBytes, _file.MimeType, _file.ContentDisposition.FileName));
            }

            var errors = ModelState.Select(x => x.Value.Errors)
                         .Where(y => y.Count > 0)
                         .ToList();
            var notificacion = new Notificacion {
                Error = false, Mensaje = ""
            };

            if (errors.Count > 0)
            {
                notificacion.Error = true;
                foreach (var item in errors)
                {
                    foreach (var item2 in item)
                    {
                        notificacion.Mensaje += item2.ErrorMessage + "<br>";
                    }
                }
            }
            return(Json(notificacion));
        }
 //Generar reporte (desprendible conductor) (S)
 public Notificacion generarDesprendible(Notificacion notificacion)
 {
     using (var db = new MapeoConductor())
     {
         return((from n in db.notificacion
                 join co in db.conduc on n.IdConductor equals co.IdConductor
                 select new
         {
             n,
             co.Nombre,
             co.Apellido,
             co.Cedula,
             co.Placa
         }).ToList().Select(m => new Notificacion
         {
             Id = m.n.Id,
             IdConductor = m.n.IdConductor,
             Tarifa = m.n.Tarifa,
             NombreCo = m.Nombre,
             ApellidoCo = m.Apellido,
             Cedula = m.Cedula,
             Placa = m.Placa
         }).Where(x => x.IdConductor == notificacion.IdConductor).FirstOrDefault());
     }
 }
        public int enviarCorreoTramiteSAT(string correo, string persona, string DNI)
        {
            var codResultado = 0;

            try
            {
                Notificacion confirmacion = new Notificacion();
                confirmacion.Body = "Estimado (a) " + persona + " ,<br><br>" +
                                    "Por medio de la presente le comunicamos que el Registro de su Trámite en la ATU se realizó satisfactoriamente.<br><br>" +
                                    "Se ha generado su trámite correctamente.<strong>" +
                                    "<br><br>Atentamente," +
                                    "<h2>Comunicaciones ATU</h2><br>" +
                                    "<hr>" +
                                    "Este mensaje de correo electrónico y / o el material adjunto puede contener información confidencial o legalmente protegida por la Ley N°  " +
                                    "29733 - Ley de Protección de Datos Personales, y es de uso exclusivo de la(s) persona(s) a quién(es)se dirige.Si no es usted el destinatario " +
                                    "indicado, queda notificado de que la lectura, uitilización, divulgación y / o copia puede estar prohibida en virtud de la legislación vigente, si " +
                                    "usted recibe este mensaje por error por favor elimine toda la información." +
                                    " <br>" +
                                    "* Este buzón es de envió automático, por favor no responder * ";

                confirmacion.arrArchivosRuta = null;
                confirmacion.To.Add(correo);
                confirmacion.asunto = "Registro de Trámite en ventanilla virtual ATU";
                confirmacion.enviar();
                codResultado = 1;
            }
            catch (Exception ex)
            {
                codResultado = 0;
            }

            return(codResultado);
        }
Beispiel #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         _sesion       = new Sesion();
         _cookieActual = _sesion.verificarValidez(Request.Cookies["PS"]);
         if (_cookieActual == null)                              // Si la cookie expira redirecciona a la pantalla de Login
         {
             Response.Redirect("../Autentificacion/Login.aspx"); //
         }
         else                                                    // Volver a crear la cookie en el cliente, con el nuevo tiempo de expiración
         {
             Response.SetCookie(_cookieActual);
         }
         _controladorPEUL = new ControladorPEUL();                 // Inicializar el controlador
         String grupoUsuario = _sesion.obtenerGrupoUsuario(_cookieActual);
         if ((grupoUsuario.Equals("prof")) || (grupoUsuario.Equals("users")) || (grupoUsuario.Equals("ests")) ||
             (grupoUsuario.Equals("operadores")))
         {
             Notificacion notificacion = new Notificacion();
             notificacion.enviarCorreo("Se ha intentado realizar un acceso no permitido por parte del usuario " + _sesion.obtenerLoginUsuario(_cookieActual) + " a la página de GestionLugar.aspx", "*****@*****.**", "Violación de Seguridad");
             Response.Redirect("../Compartido/AccesoDenegado.aspx");
         }
         _listaTipoLugar = _controladorPEUL.consultarTipoLugar();
         for (int i = 0; i < _listaTipoLugar.Count; i++)                 // Llenar el drop down de tipos de lugar
         {
             _ddlTipoLugar.Items.Add(_listaTipoLugar.ElementAt(i).ElementAt(1).ToString());
         }
         llenarTablaLugares();                 // Llenar el grid de lugares
     }
 }
Beispiel #25
0
        public List <Notificacion> reporte(Notificacion notificacion, string usuario) //Conductor
        {
            Conductor conductor1 = new LConductor(_context).mostrarDatosLogin(usuario);
            int       idCo       = conductor1.IdConductor;

            return(new LHistorialCarreras(_context).reporte(notificacion, idCo));
        }
 public void CrearNotificacion(Notificacion notificacion)
 {
     if (notificacion != null)
     {
         creadorNotificacionDBHandler.CrearNotificacion(notificacion);
     }
 }
        protected void btn_CancelarEncuentro_Click(object sender, EventArgs e)
        {
            int estado = 6; // (CANCELADO)

            EncuentroDeportivoDao.actualizarEncuentroDeportivo(int.Parse(Session["idEncuentro"].ToString()), estado);

            // Enviar notificacion

            List <Usuario> lista = UsuarioDao.UsuariosUnidosEncuentroEquipoA(int.Parse(Session["idEncuentro"].ToString()));

            //lista.AddRange(UsuarioDao.UsuariosUnidosEncuentroEquipoB(int.Parse(Session["idEncuentro"].ToString())));


            foreach (Usuario u in lista)
            {
                Notificacion notificacion = null;
                notificacion                = new Notificacion();
                notificacion.idEmisor       = int.Parse(Session["ID"].ToString());
                notificacion.nombreEmisor   = Session["Usuario"].ToString();
                notificacion.idReceptor     = u.id;
                notificacion.nombreReceptor = u.nombre;
                notificacion.idEncuentro    = int.Parse(Session["idEncuentro"].ToString());
                notificacion.texto          = "Encuentro deportivo Cancelado" + " - " +
                                              cld_Fecha.Text + " - " + txt_HoraInicio.Text + " - " + txt_NombreLugar.Text;
                notificacion.idEstado = 10;

                NotificacionDao.insertarNotificacion(notificacion);
            }

            Response.Redirect("Home.aspx");
            alertaCancelacion.Visible = true;
        }
        private void UpdateCaratula()
        {
            Notificacion notificacion = (Notificacion)notificacionBindingSource.Current;
            string       codBarras;

            if (notificacion != null && notificacion.Pelicula != null)
            {
                codBarras = notificacion.Pelicula.CodBarras;
            }
            else
            {
                codBarras = null;
            }

            if (codBarras != null)
            {
                byte[] buffer = ConnectionHelper.ServiceClient.Peliculas_ObtenerCaratula(codBarras, 0, 0);
                if (buffer != null)
                {
                    Bitmap caratula = new Bitmap(new MemoryStream(buffer));
                    caratulaPicture.Image = caratula;
                }
                else
                {
                    caratulaPicture.Image = null;
                }
            }
            else
            {
                caratulaPicture.Image = null;
            }
        }
Beispiel #29
0
        /// <summary>Maneja el evento Click del control de btnCancelar.</summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void btnCancelar_Click(object sender, EventArgs e)
        {
            Notificacion frmNotificacion = new Notificacion();

            this.Close();
            frmNotificacion.Show();
        }
Beispiel #30
0
        public Notificacion <List <Categoria> > ObtenerTopTen(EnumTipoReporteGrafico idTipoReporte, EnumTipoGrafico idTipoGrafico)
        {
            Notificacion <List <Categoria> > categoria = new Notificacion <List <Categoria> >();

            try
            {
                using (db = new SqlConnection(ConfigurationManager.AppSettings["conexionString"].ToString()))
                {
                    var parameters = new DynamicParameters();
                    parameters.Add("@idTipoReporte", idTipoReporte);
                    parameters.Add("@idTipoGrafico", idTipoGrafico);
                    var rs  = db.QueryMultiple("SP_DASHBOARD_CONSULTA_TOP_TEN", parameters, commandType: CommandType.StoredProcedure);
                    var rs1 = rs.ReadFirst();
                    if (rs1.status == 200)
                    {
                        categoria.Estatus = rs1.status;
                        categoria.Mensaje = rs1.mensaje;
                        categoria.Modelo  = rs.Read <Categoria>().ToList();
                    }
                    else
                    {
                        categoria.Estatus = rs1.status;
                        categoria.Mensaje = rs1.mensaje;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(categoria);
        }