Esempio n. 1
0
        public IActionResult AssignAgentToTicket(int ticketId)
        {
            int userId = CookieManager.GetUserId();

            _user.AssignAgentToTicket(userId, ticketId);
            return(RedirectToAction("AgentDashboard", "Home"));
        }
        public IActionResult PostComment(CommentViewModel commentViewModel)
        {
            if (ModelState.IsValid)
            {
                _comment.Text      = HtmlMarkupManager.EncodeHtml(commentViewModel.Text);
                _comment.CreatorId = CookieManager.GetUserId();
                _comment.TicketId  = commentViewModel.TicketId;
                _commentCollection.Add(_comment);
                return(RedirectToAction("Details", "Tickets", new { id = Convert.ToInt32(commentViewModel.TicketId) }));
            }

            TempData["CommentPostFailed"] = "Please write your comment before posting.";
            return(RedirectToAction("Details", "Tickets", new { id = Convert.ToInt32(commentViewModel.TicketId) }));
        }
        public IActionResult Submit(Models.ArticleModel article)
        {
            _article.Author      = article.Author;
            _article.AuthorId    = CookieManager.GetUserId();
            _article.DateCreated = article.CreatedAt;
            _article.ArticleText = ArticleTextManager.EncodeArticleText(article.Content);
            _article.Title       = article.Title;
            _article.Images      = article.Thumbnail;
            _article.LastEdited  = article.LastEdited;
            _article.TagID       = _tagColl.GetByName(article.TagName).Id;
            _article.Draft       = article.Draft;

            _artColl.Create(_article);


            TempData["Create"] = "Article was created succesfully!";
            return(RedirectToAction("AdminIndex", "Home"));
        }