예제 #1
0
        public JsonResult ultimoAnuncio(FormCollection collection)
        {
            AnunciosDAL bd    = new AnunciosDAL();
            var         model = bd.ultimoAnuncio();

            if (model != null)
            {
                var result = new { Success = true, Message = "Succes Message", model };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var result = new { Success = false, Message = "Error Message" };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }
예제 #2
0
        public JsonResult ListarLibro(FormCollection collection)
        {
            AnunciosDAL bd         = new AnunciosDAL();
            int         condominio = int.Parse(collection["Condominio"].ToString());
            var         model      = bd.ListarLibro(condominio);

            if (model != null)
            {
                var result = new { Success = true, Message = "Succes Message", model };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var result = new { Success = false, Message = "Error Message" };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }
예제 #3
0
        public JsonResult GrabarLibro(FormCollection collection)
        {
            AnunciosDAL   bd    = new AnunciosDAL();
            LIBRO_SUCESOS libro = new LIBRO_SUCESOS();

            libro.ID_CONDOMINIO = int.Parse(collection["Condominio"].ToString());
            libro.REFERENCIA    = (collection["Persona"].ToString() + " - " + collection["Perfil"].ToString());
            libro.DETALLES      = collection["Cuerpo"].ToString();
            libro.FECHA_SUCESO  = DateTime.Now;
            var model = bd.GrabarLibro(libro);

            if (model != null)
            {
                var result = new { Success = true, Message = "Succes Message", model };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var result = new { Success = false, Message = "Error Message" };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }
예제 #4
0
        public JsonResult CrearAnuncios(FormCollection collection)
        {
            AnunciosDAL bd   = new AnunciosDAL();
            ANUNCIOS    anun = new ANUNCIOS();

            anun.ID_CONDOMINIO = int.Parse(collection["Condominio"].ToString());
            anun.TITULO        = collection["Titulo"].ToString();
            anun.CUERPO        = collection["Cuerpo"].ToString();
            anun.REMITENTE     = collection["Remitente"].ToString();
            anun.FECHA_ANUNCIO = DateTime.Now;
            var model = bd.CrearAnuncio(anun);

            if (model)
            {
                var result = new { Success = true, Message = "Succes Message" };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var result = new { Success = false, Message = "Error Message" };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }