Exemplo n.º 1
0
        //GET - all companies
        public IActionResult Index()
        {
            CompaniesListViewModel companiesListVM = new CompaniesListViewModel()
            {
                Companies = _companyService.GetAllCompanies()
            };

            return(View("Company", companiesListVM));
        }
Exemplo n.º 2
0
        public IActionResult GetAllCompanies()
        {
            var companies = _company.GetAllCompanies();

            if (companies == null)
            {
                return(BadRequest());
            }

            foreach (var company in companies)
            {
                company.AddressCompany = _address.GetAddressByCompanyId(company.CompanyId);
                company.ContactCompany = _contactCompany.GetContactCompanyByCompanyId(company.CompanyId);
                company.Promoter       = _companyPromotor.GetCompanyPromoterByCompanyId(company.CompanyId);
            }
            return(Ok(companies));
        }
Exemplo n.º 3
0
        public IActionResult GetAll()
        {
            var companies = _company.GetAllCompanies();

            return(Json(new { data = companies }));
        }