public void PopulateSelections(FinancialReportEditViewModel financialReportEditViewModel) { var companies = companiesRepository.getCompanies(); List <SelectListItem> selectListCompanies = new List <SelectListItem>(); foreach (var item in companies) { selectListCompanies.Add(new SelectListItem() { Value = Convert.ToString(item.code), Text = item.name }); } financialReportEditViewModel.CompaniesList = selectListCompanies; }
// GET: Company public ActionResult Index() { ModelState.Clear(); return(View(companiesRepository.getCompanies())); }