예제 #1
0
        public JsonResult Comentar(Testimonio testimonio)
        {
            //const string FMT = "yyyy-MM-dd";
            //System.Web.HttpContext context = System.Web.HttpContext.Current;
            //string ipAddress = context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            //var rm = new ResponseModel();

            // if (ModelState.IsValid)
            //{                
            //testimonio.Usuario_id = FrontOfficeStartUp.Usuariovisualizando();
            //testimonio.IP = ipAddress;
            //testimonio.Fecha = DateTime.Now.ToString(FMT);
            //testimonio.estado = 2;
            //rm = testimonio.Guardar();
            //rm.SetResponse(true);
            // }

            var rm = new ResponseModel();

            if (ModelState.IsValid)
            {
                rm = testimonio.Guardar();

                if (rm.response) rm.message = "Gracias por comentar";
            }

            return Json(rm);

        }
예제 #2
0
        public JsonResult Guardar(Testimonio model)
        {
            ResponseModel rm = new ResponseModel();

            rm = model.Guardar();

            if (rm.response)
            {
                rm.href = "/Admin/Testimonios";
            }

            return(Json(rm));
        }
예제 #3
0
        public JsonResult Guardar(Testimonio model)
        {
            var rm = new ResponseModel();

            if (ModelState.IsValid)
            {
                rm = model.Guardar();
                if (rm.response)
                {
                    rm.href = Url.Content("~/Admin/Testimonios");
                }
            }
            return(Json(rm));
        }
예제 #4
0
        public JsonResult GuardarTestimonio(Testimonio model)
        {
            var rm = new ResponseModel();

            if (ModelState.IsValid)
            {
                rm = model.Guardar();
                if (rm.response)
                {
                    rm.message = "Gracias por comentar";
                }
            }
            return(Json(rm));
        }