コード例 #1
0
        public JsonResult Cadastro(string comentario, int topicoId)
        {
            var comments = new Comments();

            comments.comment_content = comentario;
            comments.comment_alter_date = DateTime.Now;
            comments.user_id = WebSecurity.CurrentUserId;//WebSecurity.CurrentUserId;
            comments.topico_id = topicoId;

            CommentsApp.Adicionar(comments);
            CommentsApp.Salvar();

            return Json("1", JsonRequestBehavior.DenyGet);
        }
コード例 #2
0
        public JsonResult CadastroComentarioEvento(string comentario, int eventoId)
        {
            var comments = new Comments();

            comments.comment_content = comentario;
            comments.comment_alter_date = DateTime.Now;
            comments.user_id = WebSecurity.CurrentUserId;
            comments.evento_id = eventoId;

            CommentsApp.Adicionar(comments);

            try
            {
                CommentsApp.Salvar();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return Json("1", JsonRequestBehavior.DenyGet);
        }