コード例 #1
0
        public JsonResult DeleteAula(int id)
        {
            var          aulBLL  = new AulaBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblAula aula = aulBLL.RetrieveAulaByID(id);

                if (aula != null)
                {
                    var eveBLL = new EventoBLL();
                    List <tblEvento> listaEventos = eveBLL.RetrieveEventosAulaByID(id);

                    if (listaEventos.Count() >= 0)
                    {
                        //significa que tiene Eventos....
                    }

                    var            areaBLL    = new AreasBLL();
                    List <tblArea> listaAreas = areaBLL.RetrieveAreasAulaByID(id);

                    if (listaAreas.Count() >= 0)
                    {
                        //significa que tiene Areas....
                    }

                    bool banderita = aulBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El Aula se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El Aula NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El Aula no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el Registro";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        // GET: Noticias/Delete/5
        public ActionResult DeleteNoticias(int id)
        {
            var          notBLL  = new NoticiaBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblNoticia noticia = notBLL.RetrieveNoticiaByID(id);

                if (noticia != null)
                {
                    var             lvlBLL     = new NivelBLL();
                    List <tblNivel> listaNivel = lvlBLL.RetrieveNoticiasNivelByID(id);

                    if (listaNivel.Count() >= 0)
                    {
                        //significa que tiene eventos....
                    }

                    bool banderita = notBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "La noticia se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "La noticia NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "La noticia  no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el registro";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        // GET: Edificio/Delete/5
        public JsonResult DeleteEdificio(int id)
        {
            var          ediBLL  = new EdificioBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblEdificio edificio = ediBLL.RetrieveEdificioByID(id);

                if (edificio != null)
                {
                    var            aulaBLL   = new AulaBLL();
                    List <tblAula> listaAula = aulaBLL.RetrieveAulaEdificioByID(id);

                    if (listaAula.Count() >= 0)
                    {
                        //significa que tiene Aulas....
                    }

                    bool banderita = ediBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El edificio se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El edificio NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El edificio no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el edificio";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
コード例 #4
0
        public JsonResult DeleteDias(int id)
        {
            var          diasBLL = new DiaBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblDia dia = diasBLL.RetrieveDiaByID(id);

                if (dia != null)
                {
                    var            citaBLL    = new CitaBLL();
                    List <tblCita> listaCitas = citaBLL.RetrieveCitaDiaByID(id);

                    if (listaCitas.Count() >= 0)
                    {
                        //Tiene Citas
                    }

                    bool banderita = diasBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El dia se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El dia NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El dia no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el dia";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
コード例 #5
0
        // GET: TipoAula/Delete/5
        public JsonResult DeleteTipoAula(int id)
        {
            var          taBLL   = new TipoAulaBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblTipoAula tipoaula = taBLL.RetrieveTipoAulaByID(id);

                if (tipoaula != null)
                {
                    var            auBLL      = new AulaBLL();
                    List <tblAula> listaAulas = auBLL.RetrieveAulaTipoAulaByID(id);

                    if (listaAulas.Count() >= 0)
                    {
                        //significa que tiene Aulas....
                    }

                    bool banderita = taBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El Tipo Aula se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El Tipo Aula NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El Tipo Aula no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el Tipo Aula";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
コード例 #6
0
        public JsonResult DeleteAnio(int id)
        {
            var          anioBLL = new AnioBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblAnio anio = anioBLL.RetrieveAnioByID(id);

                if (anio != null)
                {
                    var          semBLL      = new MesBLL();
                    List <tblMe> listaSemana = semBLL.RetrieveAnioMesByID(id);

                    if (listaSemana.Count() >= 0)
                    {
                        //Tiene Semanas
                    }

                    bool banderita = anioBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El anio se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El anio NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El anio no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el anio";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
コード例 #7
0
        public JsonResult ValidarUsuario(string correo_p, string password_p)
        {
            var             ocBLL          = new ColaboradorBLL();
            tblColaboradore objColaborador = ocBLL.ValidarUsuarioContrasenia(correo_p, password_p);
            wmJsonResult    objJson        = new wmJsonResult();

            if (objColaborador != null)
            {
                objJson.bandera = true;
                objJson.mensaje = objColaborador.nombreColaborador;
            }
            else
            {
                objJson.bandera = false;
                objJson.mensaje = "No se encontró usuario";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
コード例 #8
0
        public ActionResult Delete(int id)
        {
            var          usuBLL  = new UsuarioBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblUsuario Usuario = usuBLL.RetrieveUsuarioByID(id);

                if (Usuario != null)
                {
                    bool banderita = usuBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El usuario se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El usuario NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El usuario no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el usuario";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
コード例 #9
0
        // GET: Nivel/Delete/5
        public JsonResult DeleteNivel(int id)
        {
            var          lvlBLL  = new NivelBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblNivel nivel = lvlBLL.RetrieveNivelByID(id);

                if (nivel != null)
                {
                    bool banderita = lvlBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El nivel se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El nivel NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El nivel no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar elnivel";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
コード例 #10
0
        public JsonResult DeleteAnioMes(int id)
        {
            var          AmBLL   = new AnioMesBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblAnioMe AnioMes = AmBLL.RetrieveAnioMesByID(id);

                if (AnioMes != null)
                {
                    bool banderita = AmBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El Año Mes se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El Año Mes se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El Año Mes no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el resgistro";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
コード例 #11
0
        public JsonResult DeleteArea(int id)
        {
            var          aerBLL  = new AreasBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblArea area = aerBLL.RetrieveAreaByID(id);

                if (area != null)
                {
                    bool banderita = aerBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El Area se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El Area NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El Area no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el registro";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
コード例 #12
0
        // GET: Eventos/Delete/5
        public JsonResult DeleteEventos(int id)
        {
            var          eveBLL  = new EventoBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblEvento evento = eveBLL.RetrievEventoByID(id);

                if (evento != null)
                {
                    bool banderita = eveBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El evento se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El evento NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El evento no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el evento";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
コード例 #13
0
        public JsonResult DeleteColaborador(int id)
        {
            var          colBLL  = new ColaboradorBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblColaboradore colaborador = colBLL.RetrieveColaboradorByID(id);

                if (colaborador != null)
                {
                    var eveBLL = new EventoBLL();
                    List <tblEvento> listaEventos = eveBLL.RetrieveEventosColaboradorByID(id);

                    if (listaEventos.Count() >= 0)
                    {
                        //significa que tiene eventos....
                    }

                    var            areaBLL   = new AreasBLL();
                    List <tblArea> listaArea = areaBLL.RetrieveAreasColaboradorByID(id);

                    if (listaArea.Count() >= 0)
                    {
                        //significa que tiene areas asignadas....
                    }

                    var            citBLL     = new CitaBLL();
                    List <tblCita> listaCitas = citBLL.RetrieveCitasColaboradorByID(id);

                    if (listaCitas.Count() >= 0)
                    {
                        //significa que tiene areas asignadas....
                    }

                    bool banderita = colBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El colaborador se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El colaborador NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El colaborador no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el registro";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }