示例#1
0
 def get_city_count(self):
     response = RegionResponse()
     try:
         result = self.modelRegionService.get_city_count()
         response.rows = result
     except Exception as e:
         response.success = False
         response.message = str(e)
     return response
示例#2
0
 def get_city_by_page(self, start, offset):
     response = RegionResponse()
     try:
         result = self.modelRegionService.get_city_by_page(start, offset)
         response.rows = result
     except Exception as e:
         response.success = False
         response.message = str(e)
     return response
示例#3
0
 def delete_county(self, county_nid):
     response = RegionResponse()
     try:
         result = self.modelRegionService.delete_county(county_nid)
         response.rows = result
     except Exception as e:
         response.success = False
         response.message = str(e)
     return response
示例#4
0
 def get_city_by_province(self, province_nid):
     response = RegionResponse()
     try:
         result = self.modelRegionService.get_city_by_province(province_nid)
         response.rows = result
     except Exception as e:
         response.success = False
         response.message = str(e)
     return response
示例#5
0
 def get_province_count(self):
     response = RegionResponse()
     try:
         count = self.modelRegionService.get_province_count()
         response.rows = count
     except Exception as e:
         response.success = False
         response.message = str(e)
     return response
示例#6
0
 def create_province(self, caption):
     response = RegionResponse()
     try:
         result = self.modelRegionService.create_province(caption)
         response.rows = result
         if not result:
             response.success = False
             response.message = '省份已经存在'
     except Exception as e:
         response.success = False
         response.message = str(e)
     return response
示例#7
0
 def create_county(self, city_nid, caption):
     response = RegionResponse()
     try:
         result = self.modelRegionService.create_county(city_nid, caption)
         response.rows = result
         if not result:
             response.success = False
             response.message = '县(区)已经存在'
     except Exception as e:
         response.success = False
         response.message = str(e)
     return response
示例#8
0
 def modify_province(self, province_nid, replace):
     response = RegionResponse()
     try:
         result = self.modelRegionService.modify_province(
             province_nid, replace)
         response.rows = result
         if not result:
             response.success = False
             response.message = '省份已经存在'
     except Exception as e:
         response.success = False
         response.message = str(e)
     return response
示例#9
0
 def modify_county(self, nid, city_nid, replace):
     response = RegionResponse()
     try:
         result = self.modelRegionService.modify_county(
             nid, city_nid, replace)
         response.rows = result
         if not result:
             response.success = False
             response.message = '县(区)已经存在'
     except Exception as e:
         response.success = False
         response.message = str(e)
     return response