public JsonResult agregarComentario(DatosCrearComentario datos)
 {
     try
     {
         String tiendaId = Session["Tienda_Nombre"].ToString();
         Comentario c = new Comentario
         {
             texto = datos.texto,
             fecha = datos.fecha,
             ProductoID = datos.prodId,
             UsuarioID = datos.userId
         };
         cS.AgregarComentario(c, tiendaId);
         var result = new { Success = "True" };
         return Json(result, JsonRequestBehavior.AllowGet);
     }
     catch (Exception e)
     {
         var result = new { Success = "False", Message = e.Message };
         return Json(result, JsonRequestBehavior.AllowGet);
     }
 }
Exemple #2
0
 public JsonResult agregarComentario(DatosCrearComentario datos)
 {
     try
     {
         String     tiendaId = Session["Tienda_Nombre"].ToString();
         Comentario c        = new Comentario
         {
             texto      = datos.texto,
             fecha      = datos.fecha,
             ProductoID = datos.prodId,
             UsuarioID  = datos.userId
         };
         cS.AgregarComentario(c, tiendaId);
         var result = new { Success = "True" };
         return(Json(result, JsonRequestBehavior.AllowGet));
     }
     catch (Exception e)
     {
         var result = new { Success = "False", Message = e.Message };
         return(Json(result, JsonRequestBehavior.AllowGet));
     }
 }