예제 #1
0
        public string GetAeCompaniesJson([FromBody] AccountExecutiveData accountExecutive)
        {
            SetTimeout();

            var     dataAccess  = new CompaniesRepository();
            dynamic response    = CompaniesRepository.GetCompanies();
            var     aeCompanies = new List <CompanyData>();

            foreach (JObject companyRecord in response.companies)
            {
                var company = companyRecord.ToObject <CompanyData>();

                if (company == null)
                {
                    continue;
                }

                var companyAe = company.AccountExecutive;

                if (string.Equals(companyAe, accountExecutive.AccountExecutive, StringComparison.CurrentCultureIgnoreCase))
                {
                    aeCompanies.Add(company);
                }
            }

            var output = JsonConvert.SerializeObject(
                aeCompanies,
                new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            });

            return(output);
        }
예제 #2
0
        public string GetCompaniesJson()
        {
            SetTimeout();

            var     dataAccess = new CompaniesRepository();
            dynamic companies  = CompaniesRepository.GetCompanies();
            string  output     = JsonConvert.SerializeObject(companies.companies);

            return(output);
        }
예제 #3
0
        public ActionResult Index()
        {
            List <Company> companies = _companiesRepository.GetCompanies();

            ViewBag.SelectedNav = "Dashboard";
            if (TempData["ErrorMessage"] != null)
            {
                ViewBag.ErrorMessage = TempData["ErrorMessage"].ToString();
            }
            return(View(companies));
        }