コード例 #1
0
        // GET: Article
        public ActionResult Index()
        {
            HomeViewModel model = new HomeViewModel();

            model.ReportList = new List <ReportViewModel>();
            var reports = _reportLogic.GetAll();

            foreach (var item in reports)
            {
                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
                };
                model.ReportList.Add(report);
            }
            return(View(model));
        }
コード例 #2
0
        public ActionResult Index()
        {
            List <ReportViewModel> model = new List <ReportViewModel>();
            var reports = _reportLogic.GetAll();

            foreach (var item in reports)
            {
                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, Type = item.Type
                };
                model.Add(report);
            }
            return(View(model));
        }