Exemple #1
0
        public IActionResult Detail(int branchId)
        {
            LibraryBranch branch = _branches.GetLibraryBranch(branchId);

            BranchDetailModel model = new BranchDetailModel()
            {
                Id               = branch.Id,
                BranchName       = branch.Name,
                Address          = branch.Address,
                Description      = branch.Description,
                Telephone        = branch.Telephone,
                BranchOpenedDate = branch.OpenDate.ToString("yyyy-MM-dd"),
                ImageUrl         = branch.ImageUrl,
                IsOpen           = _branches.IsBranchOpen(branch.Id) ? "Open" : "Closed",
                HoursOpen        = _branches.GetBranchHours(branch.Id),
                NumberOfAssets   = _branches.GetAssetCount(branch.Id),
                NumberOfPatrons  = _branches.GetPatronCount(branch.Id),
                TotalAssetValue  = _branches.GetAssetsValue(branch.Id)
            };

            return(View(model));
        }