public async Task <IActionResult> Index(int id) { var company = _officeManagementService.GetCompany(id); var model = new CompanyIndexViewModel(); // if Image Not Found in the local directory then download from S3 Bucket if (model.CheckAvailabilityFile(company.LogoImageUrl) == false && company.LogoImageUrl != null) { await new CompanyIndexViewModel().DownloadCompanyProfileImageAsync(company.LogoImageUrl); } if (model.CheckAvailabilityFile(company.OfficePhotoUrl) == false && company.OfficePhotoUrl != null) { await new CompanyIndexViewModel().DownloadCompanyOfficePhotoAsync(company.OfficePhotoUrl); } return(View(company)); }
public IActionResult Index() { var userId = User.FindFirstValue(ClaimTypes.NameIdentifier); var company = _officeManagementService.GetCompanyByUserId(userId); var companyWithChildTable = _officeManagementService.GetCompany(company.Id); ViewBag.ServicesCount = companyWithChildTable.Services.Count(); ViewBag.ProductsCount = companyWithChildTable.Products.Count(); ViewBag.ProjectsCount = companyWithChildTable.Projects.Count(); return(View()); }