示例#1
0
    public static TinhThanh GetProvinceById(int matinh)
    {
        var res = proRepo.Find(matinh);

        res.QuanHuyens = new List <QuanHuyen>();
        return(res);
    }
示例#2
0
        public HttpResponseMessage GetCitiesByProvinceID(int provinceId)
        {
            ResultMsg resultMsg = new ResultMsg();

            try
            {
                string provinceCode = string.Empty;
                using (IProvince repository = new ProvinceRepository())
                {
                    provinceCode = repository.Find(provinceId).ProvinceCode;
                }
                using (ICity repository = new CityRepository())
                {
                    var list = repository.FindAll(o => o.ProvinceCode == provinceCode);
                    resultMsg.code = 0;
                    resultMsg.data = list;
                }
            }
            catch (Exception ex)
            {
                resultMsg.code = (int)StatusCodeEnum.Error;
                resultMsg.msg  = ex.Message;
            }
            return(resultMsg.toJson());
        }
 public ActionResult Details(int?id)
 {
     return(View(IPV.Find(id)));
 }