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); }
public JsonResult Guardar(Testimonio model) { ResponseModel rm = new ResponseModel(); rm = model.Guardar(); if (rm.response) { rm.href = "/Admin/Testimonios"; } return(Json(rm)); }
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)); }
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)); }