private string GetCityNameById(int idDep, int idCity)
        {
            var    city = cityHandler.GetCityByDepartamentId(idDep);
            string name = string.Empty;

            if (city != null)
            {
                var fil = city.FirstOrDefault(c => c.Id == idCity);
                name = fil != null ? fil.Name : string.Empty;
            }
            return(name);
        }
示例#2
0
        /// <summary>
        /// Obtiene las ciudades por departamento
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public HttpResponseMessage GetCityByDepartament(int id)
        {
            CityHandler cityHandler = new CityHandler();

            return(Request.CreateResponse(HttpStatusCode.OK, cityHandler.GetCityByDepartamentId(id)));
        }