예제 #1
0
 //[Authorize(Roles = "3")]
 public ActionResult Delete(string id, string id2, string id3, FormCollection collection)
 {
     try
     {
         NotificacionesProfesorModels   NotificacionProfesor      = new NotificacionesProfesorModels();
         _Notificaciones_Profesor_Datos NotificacionProfesorDatos = new _Notificaciones_Profesor_Datos();
         NotificacionProfesor.conexion = Conexion;
         NotificacionProfesor.IDNotificacionGeneral = id;
         NotificacionProfesor.id_profesor           = id2;
         NotificacionProfesor.grupo        = id3;
         NotificacionProfesor.opcion       = 2;
         NotificacionProfesor.TablaAlumnos = new DataTable();
         NotificacionProfesor.TablaAlumnos.Columns.Add("id_alumno", typeof(string));
         NotificacionProfesor.user = User.Identity.Name;
         NotificacionProfesorDatos.insertarNotificacion(NotificacionProfesor);
         if (NotificacionProfesor.Resultado == 1)
         {
             TempData["typemessage"] = "1";
             TempData["message"]     = "El registro se elimino correctamente.";
             return(Json(""));
         }
         else
         {
             TempData["typemessage"] = "2";
             TempData["message"]     = "El registro no se elimino correctamente.";
             return(Json(""));
         }
     }
     catch
     {
         return(View());
     }
 }
예제 #2
0
        // GET: Admin/NotificacionProfesor
        public ActionResult Index()
        {
            try
            {
                NotificacionesProfesorModels   NotificacionProfesor      = new NotificacionesProfesorModels();
                _Notificaciones_Profesor_Datos NotificacionProfesorDatos = new _Notificaciones_Profesor_Datos();
                NotificacionProfesor.conexion = Conexion;



                NotificacionProfesor.TablaCicloEscolarCmb = NotificacionProfesorDatos.ObtenerComboCatCicloEscolar(NotificacionProfesor);
                var list = new SelectList(NotificacionProfesor.TablaCicloEscolarCmb, "IDCiclo", "Nombre");
                ViewData["cmbCicloEscolar"] = list;

                NotificacionProfesor.TablaPlanEstudioCmb = NotificacionProfesorDatos.ObtenerComboCatPlanEstudio(NotificacionProfesor);
                var listaPE = new SelectList(NotificacionProfesor.TablaPlanEstudioCmb, "IDPlanEstudio", "Descripcion");
                ViewData["cmbPlanEstudio"] = listaPE;

                NotificacionProfesor.TablaModalidadCmb = NotificacionProfesorDatos.ObtenerComboCatModalidad(NotificacionProfesor);
                var listModalidad = new SelectList(NotificacionProfesor.TablaModalidadCmb, "IDModalidad", "Descripcion");
                ViewData["cmbModalidad"] = listModalidad;

                NotificacionProfesor.TablaEspecialidadCmb = NotificacionProfesorDatos.ObtenerComboCatEspecialidad(NotificacionProfesor);
                var listEspecialidad = new SelectList(NotificacionProfesor.TablaEspecialidadCmb, "id_especialidad", "descripcion");
                ViewData["cmbEspecialidad"] = listEspecialidad;

                NotificacionProfesor.TablaCursosCmb = NotificacionProfesorDatos.ObtenerComboCatCursos(NotificacionProfesor);
                var listCursos = new SelectList(NotificacionProfesor.TablaCursosCmb, "IDCurso", "Descripcion");
                ViewData["cmbCursos"] = listCursos;


                NotificacionProfesor.TablaGrupoCmb = NotificacionProfesorDatos.ObtenerComboCatGrupo(NotificacionProfesor);
                var listGrupoOr = new SelectList(NotificacionProfesor.TablaGrupoCmb, "IDGrupo", "Nombre");
                ViewData["cmbGrupo"] = listGrupoOr;

                NotificacionProfesor.TablaProfesorCmb = NotificacionProfesorDatos.obtenerComboCatCatedraticos(NotificacionProfesor);
                var listaProfesor = new SelectList(NotificacionProfesor.TablaProfesorCmb, "id_persona", "nombre");
                ViewData["cmbProfesor"] = listaProfesor;

                NotificacionProfesor.TablaDatos = new DataTable();

                //NotificacionProfesor = NotificacionProfesorDatos.obtenerCatNotificacionProfesor(NotificacionProfesor);
                return(View(NotificacionProfesor));
            }
            catch (Exception ex) {
                throw ex;
            }
        }
예제 #3
0
        //[Authorize(Roles = "3")]
        public ActionResult ComboCursos(string IDEspecialidad)
        {
            try
            {
                NotificacionesProfesorModels   NotificacionProfesor      = new NotificacionesProfesorModels();
                _Notificaciones_Profesor_Datos NotificacionProfesorDatos = new _Notificaciones_Profesor_Datos();

                List <CatCursoModels> listaEspecialidad = new List <CatCursoModels>();
                NotificacionProfesor.conexion       = Conexion;
                NotificacionProfesor.IDEspecialidad = IDEspecialidad;

                listaEspecialidad = NotificacionProfesorDatos.ObtenerComboCatCursos(NotificacionProfesor);
                return(Json(listaEspecialidad, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
                return(Json("", JsonRequestBehavior.AllowGet));
            }
        }
예제 #4
0
        //[Authorize(Roles = "3")]
        public ActionResult ComboModalidad(int idplanEstudio)
        {
            try
            {
                NotificacionesProfesorModels   NotificacionProfesor      = new NotificacionesProfesorModels();
                _Notificaciones_Profesor_Datos NotificacionProfesorDatos = new _Notificaciones_Profesor_Datos();

                List <CatModalidadModels> listaModalidad = new List <CatModalidadModels>();
                NotificacionProfesor.conexion      = Conexion;
                NotificacionProfesor.idplanEstudio = idplanEstudio;

                listaModalidad = NotificacionProfesorDatos.ObtenerComboCatModalidad(NotificacionProfesor);
                return(Json(listaModalidad, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
                return(Json("", JsonRequestBehavior.AllowGet));
            }
        }
예제 #5
0
        public ActionResult TablaNotificacionesEnviadas(string id, string id2)
        {
            try
            {
                NotificacionesProfesorModels   NotificacionProfesor      = new NotificacionesProfesorModels();
                _Notificaciones_Profesor_Datos NotificacionProfesorDatos = new _Notificaciones_Profesor_Datos();
                NotificacionProfesor.conexion = Conexion;

                NotificacionProfesor.id_profesor = id;
                NotificacionProfesor.grupo       = id2;


                NotificacionProfesor = NotificacionProfesorDatos.obtenerCatNotificacionProfesorEnviadas(NotificacionProfesor);
                return(View(NotificacionProfesor));
                //return RedirectToAction("TablaNotificacion");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #6
0
        //[Authorize(Roles = "3")]
        public ActionResult ComboProfesor(string grupo)
        {
            try
            {
                NotificacionesProfesorModels   NotificacionProfesor      = new NotificacionesProfesorModels();
                _Notificaciones_Profesor_Datos NotificacionProfesorDatos = new _Notificaciones_Profesor_Datos();

                List <CatCatedraticoModels> listaGrupo = new List <CatCatedraticoModels>();
                NotificacionProfesor.conexion = Conexion;
                NotificacionProfesor.grupo    = grupo;


                listaGrupo = NotificacionProfesorDatos.obtenerComboCatCatedraticos(NotificacionProfesor);
                return(Json(listaGrupo, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
                return(Json("", JsonRequestBehavior.AllowGet));
            }
        }
예제 #7
0
        public ActionResult Detalle(string id, string id2, string id3)
        {
            try
            {
                NotificacionesProfesorModels   NotificacionProfesor      = new NotificacionesProfesorModels();
                _Notificaciones_Profesor_Datos NotificacionProfesorDatos = new _Notificaciones_Profesor_Datos();
                NotificacionProfesor.conexion = Conexion;
                NotificacionProfesor.IDNotificacionGeneral = id;
                NotificacionProfesor.id_profesor           = id2;

                NotificacionProfesor.grupo = id3;
                NotificacionProfesor       = NotificacionProfesorDatos.obtenerDetalleCatNotificacionGeneralXID(NotificacionProfesor);

                return(View(NotificacionProfesor));
            }
            catch (Exception)
            {
                NotificacionModels Notificacion = new NotificacionModels();
                TempData["typemessage"] = "2";
                TempData["message"]     = "No se puede cargar la vista";
                return(View(Notificacion));
            }
        }
예제 #8
0
        //[Authorize(Roles = "3")]
        public ActionResult llenarTabla(string id_profesor, string id_grupo)
        {
            try
            {
                NotificacionesProfesorModels   NotificacionProfesor      = new NotificacionesProfesorModels();
                _Notificaciones_Profesor_Datos NotificacionProfesorDatos = new _Notificaciones_Profesor_Datos();


                NotificacionProfesor.conexion    = Conexion;
                NotificacionProfesor.id_profesor = id_profesor;
                NotificacionProfesor.grupo       = id_grupo;

                NotificacionProfesor = NotificacionProfesorDatos.obtenerCatNotificacionProfesor(NotificacionProfesor);


                var list = new List <Dictionary <string, object> >();

                foreach (DataRow row in NotificacionProfesor.TablaDatos.Rows)
                {
                    var dict = new Dictionary <string, object>();

                    foreach (DataColumn col in NotificacionProfesor.TablaDatos.Columns)
                    {
                        dict[col.ColumnName] = (Convert.ToString(row[col]));
                    }
                    list.Add(dict);
                }
                JavaScriptSerializer serializer = new JavaScriptSerializer();

                return(Json(list, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
                return(Json("", JsonRequestBehavior.AllowGet));
            }
        }
예제 #9
0
        public ActionResult ReenviarNotificacion(string id, string id2, int id3)
        {
            try
            {
                NotificacionesProfesorModels   NotificacionProfesor      = new NotificacionesProfesorModels();
                _Notificaciones_Profesor_Datos NotificacionProfesorDatos = new _Notificaciones_Profesor_Datos();
                _NotificacionCadena_Datos      NotificacionCadenaDatos   = new _NotificacionCadena_Datos();
                NotificacionProfesor.IDTipoNotificacion    = id3;
                NotificacionProfesor.conexion              = Conexion;
                NotificacionProfesor.IDNotificacionGeneral = id;
                NotificacionProfesor.id_registro           = id2;
                NotificacionProfesor.user = User.Identity.Name;
                NotificacionProfesorDatos.ReenviarNotificacion(NotificacionProfesor);

                if (NotificacionProfesor.Resultado == 1)
                {
                    NotificacionProfesor.TablaNotificacionXTipo = new DataTable();
                    NotificacionProfesor.TablaNotificacionXTipo.Columns.Add("IDNotificacion", typeof(string));
                    NotificacionProfesor.TablaNotificacionXTipo.Columns.Add("Titulo", typeof(string));
                    NotificacionProfesor.TablaNotificacionXTipo.Columns.Add("Cadena", typeof(string));
                    NotificacionProfesor.TablaNotificacionXTipo.Columns.Add("Resumen", typeof(string));
                    foreach (DataRow notificacion in NotificacionProfesor.TablaAlumnos.Rows)
                    {
                        if (NotificacionProfesor.IDTipoNotificacion == 110)
                        {
                            NotificacionProfesor.nombreAlumno          = notificacion["nombreCompleto"].ToString();
                            NotificacionProfesor.fechaEvento           = Convert.ToDateTime(notificacion["fechaEvento"].ToString());
                            NotificacionProfesor.nombreEvento          = notificacion["nombreEvento"].ToString();
                            NotificacionProfesor.notificacionPlantilla = notificacion["descripcion"].ToString();
                            NotificacionProfesor.resumen  = notificacion["resumen"].ToString();
                            NotificacionProfesor.materia  = notificacion["materia"].ToString();
                            NotificacionProfesor.profesor = notificacion["profesor"].ToString();
                            NotificacionCadenaDatos.CadenaFinal(NotificacionProfesor);
                        }
                        else if (NotificacionProfesor.IDTipoNotificacion == 111)
                        {
                            NotificacionProfesor.nombreAlumno          = notificacion["nombreCompleto"].ToString();
                            NotificacionProfesor.fechaEvento           = Convert.ToDateTime(notificacion["fechaExamen"].ToString());
                            NotificacionProfesor.nombreEvento          = notificacion["nombreExamen"].ToString();
                            NotificacionProfesor.calificacion          = Convert.ToSingle(notificacion["calificacion"].ToString());
                            NotificacionProfesor.materia               = notificacion["materia"].ToString();
                            NotificacionProfesor.notificacionPlantilla = notificacion["descripcion"].ToString();
                            NotificacionProfesor.resumen               = notificacion["resumen"].ToString();
                            NotificacionProfesor.profesor              = notificacion["profesor"].ToString();
                            NotificacionCadenaDatos.CadenaFinal(NotificacionProfesor);
                        }
                        else if (NotificacionProfesor.IDTipoNotificacion == 112)
                        {
                            NotificacionProfesor.nombreAlumno          = notificacion["nombreCompleto"].ToString();
                            NotificacionProfesor.fechaTarea            = Convert.ToDateTime(notificacion["fechaEntrega"].ToString());
                            NotificacionProfesor.nombreEvento          = notificacion["nombreTarea"].ToString();
                            NotificacionProfesor.calificacion          = Convert.ToSingle(notificacion["calificacion"].ToString());
                            NotificacionProfesor.materia               = notificacion["materia"].ToString();
                            NotificacionProfesor.notificacionPlantilla = notificacion["descripcion"].ToString();
                            NotificacionProfesor.resumen               = notificacion["resumen"].ToString();
                            NotificacionProfesor.profesor              = notificacion["profesor"].ToString();
                            NotificacionCadenaDatos.CadenaFinal(NotificacionProfesor);
                        }
                        else if (NotificacionProfesor.IDTipoNotificacion == 113)
                        {
                            NotificacionProfesor.nombreAlumno          = notificacion["nombreCompleto"].ToString();
                            NotificacionProfesor.fechaTarea            = Convert.ToDateTime(notificacion["fechaLista"].ToString());
                            NotificacionProfesor.calificacion          = Convert.ToSingle(notificacion["calificacion"].ToString());
                            NotificacionProfesor.materia               = notificacion["materia"].ToString();
                            NotificacionProfesor.notificacionPlantilla = notificacion["descripcion"].ToString();
                            NotificacionProfesor.resumen               = notificacion["resumen"].ToString();
                            NotificacionProfesor.profesor              = notificacion["profesor"].ToString();
                            NotificacionCadenaDatos.CadenaFinal(NotificacionProfesor);
                        }
                        NotificacionProfesor.TablaNotificacionXTipo.Rows.Add(notificacion["id_notificacionDetalle"].ToString(), notificacion["titulo"].ToString(), NotificacionProfesor.notificacionFinal, notificacion["resumen"].ToString());


                        string descripcion = NotificacionProfesor.notificacionFinal;
                        int    Bagde = 0, IDTipoCelular = 0;
                        Bagde         = Convert.ToInt32(notificacion["badge"].ToString());
                        IDTipoCelular = Convert.ToInt32(notificacion["idTipoCelular"].ToString());

                        Comun.EnviarMensaje(notificacion["token"].ToString(), notificacion["titulo"].ToString(), notificacion["resumen"].ToString(), Bagde, IDTipoCelular);
                    }
                    NotificacionProfesorDatos.actualizarDetalleNotificacion(NotificacionProfesor);
                }


                TempData["message"] = "El reenvio se llevó a cabo correctamente";
                return(Json(""));
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
                return(Json("", JsonRequestBehavior.AllowGet));
            }
        }