Exemple #1
0
        public IActionResult Detail(int id)
        {
            var branch = _branchService.Get(id);
            var model  = new BranchDetailModel
            {
                Name             = branch.Name,
                Description      = branch.Description,
                Address          = branch.Address,
                Telephone        = branch.Telephone,
                ImageURL         = branch.ImageUrl,
                BranchOpenedDate = branch.OpenDate.ToString("yyyy-MM-dd"),
                NumberOfPatrons  = _branchService.GetPatronCount(id),
                NumberOfAssets   = _branchService.GetAssetCount(id),
                TotalAssetValue  = _branchService.GetAssetsValue(id),

                HoursOpen   = _branchService.GetBranchHours(id),
                AssetsTitle = _branchService.GetAssetsTitle(id)
            };

            return(View(model));
        }