// GET: Feedback/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Feedback feedback = _feedbackManager.FindById((int)id);

            if (feedback == null)
            {
                return(HttpNotFound());
            }
            FeedbackViewModel feedbackViewModel = Mapper.Map <FeedbackViewModel>(feedback);

            return(View(feedbackViewModel));
        }
예제 #2
0
 public ActionResult Reply(int feedbackId)
 {
     try
     {
         Feedback feedback = _feedbackManager.FindById((int)feedbackId);
         if (feedback == null)
         {
             return(HttpNotFound());
         }
         FeedbackViewModel feedbackViewModel = Mapper.Map <FeedbackViewModel>(feedback);
         return(View(feedbackViewModel));
     }
     catch (Exception ex)
     {
         return(View("Error", new HandleErrorInfo(ex, "Requisitions", "Reply")));
     }
 }
예제 #3
0
        //private RmsDbContext db = new RmsDbContext();

        // GET: Reply
        //public ActionResult Index()
        //{
        //    var replyViewModels = db.ReplyViewModels.Include(r => r.Employee).Include(r => r.Feedback);
        //    return View(replyViewModels.ToList());
        //}

        // GET: Reply/Details/5
        //public ActionResult Details(int? id)
        //{
        //    if (id == null)
        //    {
        //        return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        //    }
        //    ReplyViewModel replyViewModel = db.ReplyViewModels.Find(id);
        //    if (replyViewModel == null)
        //    {
        //        return HttpNotFound();
        //    }
        //    return View(replyViewModel);
        //}

        // GET: Reply/Create
        public ActionResult Create(int commentId)
        {
            if (commentId == 0 || commentId == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Feedback feedback = _feedbackManager.FindById(commentId);

            if (feedback == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Feedback = feedback;
            ReplyViewModel replyViewModel = new ReplyViewModel();

            replyViewModel.FeedbackId = feedback.Id;


            return(View(replyViewModel));
        }