public HttpResponseMessage GetAreasByCityID(int cityId) { ResultMsg resultMsg = new ResultMsg(); try { string cityCode = string.Empty; using (ICity repository = new CityRepository()) { cityCode = repository.Find(cityId).CityCode; } using (IArea repository = new AreaRepository()) { var list = repository.FindAll(o => o.CityCode == cityCode); resultMsg.code = 0; resultMsg.data = list; } } catch (Exception ex) { resultMsg.code = (int)StatusCodeEnum.Error; resultMsg.msg = ex.Message; } return(resultMsg.toJson()); }
public DAL.Entity.City GetCity(int id) { try { return(_ICityRepository.Find(id)); } catch (Exception exception) { exception.Log(); return(null); } }
public City Find() { int cid_codigo = Convert.ToInt32(Url.ActionContext.RouteData.Values["cid_codigo"]); return(CityRepository.Find(cid_codigo)); }
// // GET: /City/Details/5 public ActionResult Details(int?id) { return(View(ICR.Find(id))); }