public ActionResult LoadCompanyDetail(int id) { int company_id = Convert.ToInt32(id); company company = new company(); company = company_id > 0 ? db.companies.Find(company_id) : company; if (company != null) { ViewBag.country_id = new SelectList(countryUtil.GetCountrySelectList(), "Value", "Text", company.state_id != null ? company.state.country_id : 0); ViewBag.StateName = company.state != null?stateUtil.GetStateSelectList(company.state.country_id) : stateUtil.GetStateName(); ViewBag.TimeZone = STUtil.GetTimeZoneInfo(); } return(PartialView("_CompanyDetail", company)); }