예제 #1
0
        public JsonResult GetStatesByCountry(int country_id)
        {
            List <object>  states       = new List <object>();
            StatesServices stateService = new StatesServices();

            foreach (var state in stateService.GetStatesForDropDownList(country_id))
            {
                states.Add(
                    new
                {
                    optionValue   = state.Key,
                    optionDisplay = state.Value
                });
            }

            return(Json(states));
        }
예제 #2
0
 public StatesController(StatesServices _stateService)
 {
     this._stateService = _stateService;
 }
예제 #3
0
 public StatesController()
 {
     _stateService = new StatesServices();
 }