// GET: Report/Details/5
        public ActionResult Details(int id)
        {
            var             item   = _reportLogic.GetById(id);
            ReportViewModel report = new ReportViewModel()
            {
                Address = item.Address, Description = item.Description, Name = item.Name, Origin = item.Origin, CreatedDate = item.CreatedDate.ToString("dd-MMM-yyyy hh:mm"), Status = item.Status, Id = item.Id, AssignedDate = item.ProcessDate.HasValue ? item.ProcessDate.Value.ToString("dd-MMM-yyyy hh:mm") : string.Empty, PhoneNumber = item.PhoneNumber, AssignedToPPK = item.PPK != null ? item.PPK.Name : string.Empty, ClosedDate = item.ClosedDate.HasValue ? item.ClosedDate.Value.ToString("dd-MMM-yyyy hh:mm") : string.Empty, StaffComment = item.StaffComment, PPKComment = item.PPKComment
            };

            return(View(report));
        }
        public ActionResult PPKComment(int id)
        {
            ViewData["ReportId"] = id;
            PPKCommentViewModel comment = new PPKCommentViewModel();
            var report = _reportLogic.GetById(id);

            comment.PPKComment = report.PPKComment;
            return(View(comment));
        }
Exemple #3
0
        public void ReportLogic_GetByIdOfReport_ReturnNull()
        {
            Mock <IReportDAO> mockDAO = new Mock <IReportDAO>();

            mockDAO.Setup(t => t.GetById(It.IsAny <Guid>())).Verifiable();

            ReportLogic logic = new ReportLogic(mockDAO.Object, Mock.Of <IUserDAO>(), Mock.Of <ICustomLogger>());
            Guid        idOfReportThatNotExist = new Guid();

            Report foundReport = logic.GetById(idOfReportThatNotExist);

            Assert.AreEqual(foundReport, null);
            mockDAO.VerifyAll();
        }