コード例 #1
0
        // 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));
        }
コード例 #2
0
        public ActionResult PPKComment(int id)
        {
            ViewData["ReportId"] = id;
            PPKCommentViewModel comment = new PPKCommentViewModel();
            var report = _reportLogic.GetById(id);

            comment.PPKComment = report.PPKComment;
            return(View(comment));
        }
コード例 #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();
        }