Exemplo n.º 1
0
        public ActionResult PreviousJobs(JobViewModel payload)
        {
            var success = CommentServiceProvider.PostComment(payload);

            if (success)
            {
                TempData["success"] = true;
            }
            else
            {
                TempData["failed"] = true;
            }
            return(RedirectToRoute("Job_Details", new { name = payload.Name }));
        }
Exemplo n.º 2
0
        public ActionResult PreviousJobs(string name)
        {
            var job = JobServiceProvider.GetJobByTitle(name);

            job.Comments = CommentServiceProvider.GetCommentsByJobId(job.JobId);
            if (TempData["success"] != null)
            {
                ViewBag.Success = "Your comment was posted I hope you are happy about it";
            }
            if (TempData["failed"] != null)
            {
                ViewBag.Failed = "No comment posted sooon";
            }
            return(View(job));
        }