public async Task <IActionResult> Index(int id) { var housHolds = await _client.GetHousholdsAsync(id); var contracts = await _client.GetContractsAsync(id); var partner = await _client.GetPartnerAsync(id); var proposals = await _client.GetProposalsAsync(id); var offers = await _client.GetOffersAsync(id); var contacts = await _client.GetContactsAsync(id); var viewModel = new PartnerOverviewViewModel(); viewModel.Title = $"{partner.Firstname} {partner.Name} - Deckblatt"; viewModel.Branches = _client.GetBranches(contracts); viewModel.Housholds = housHolds; viewModel.Contracts = contracts; viewModel.Partner = partner; viewModel.Contacts = contacts; viewModel.Proposals = proposals; viewModel.Offers = offers; ViewBag.Partner = partner; ViewBag.PartnerId = id; return(View(viewModel)); }
public async Task <IActionResult> Index(int partnerId) { var offers = await _client.GetOffersAsync(partnerId); return(View(new OffersOverviewViewModel { IsEmbedded = Request.Headers.ContainsKey("embedded") ? Convert.ToBoolean(Request.Headers["embedded"]) : false, Offers = offers })); }