예제 #1
0
        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());
        }
예제 #2
0
 public DAL.Entity.City GetCity(int id)
 {
     try
     {
         return(_ICityRepository.Find(id));
     }
     catch (Exception exception)
     {
         exception.Log();
         return(null);
     }
 }
예제 #3
0
        public City Find()
        {
            int cid_codigo = Convert.ToInt32(Url.ActionContext.RouteData.Values["cid_codigo"]);

            return(CityRepository.Find(cid_codigo));
        }
예제 #4
0
 //
 // GET: /City/Details/5
 public ActionResult Details(int?id)
 {
     return(View(ICR.Find(id)));
 }