Ejemplo n.º 1
0
 /// <summary>
 /// 获取管网信息通过坐标(EPSG:4547)
 /// </summary>
 /// <param name="latitude">纬度</param>
 /// <param name="longitude">精度</param>
 /// <returns></returns>
 public MessageEntity Get(string latitude, string longitude)
 {
     if (!string.IsNullOrEmpty(latitude) && !string.IsNullOrEmpty(longitude))
     {
         string regexExpression = @"^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$";
         if (Regex.IsMatch(latitude, regexExpression) && Regex.IsMatch(longitude, regexExpression))
         {
             var pipe = _pipeDAL.Get(latitude, longitude, out string errMessage);
             if (pipe != null)
             {
                 return(MessageEntityTool.GetMessage(1, pipe));
             }
             else
             {
                 return(MessageEntityTool.GetMessage(ErrorType.SqlError, errMessage));
             }
         }
         else
         {
             return(MessageEntityTool.GetMessage(ErrorType.FieldError, "", "坐标格式有误"));
         }
     }
     else
     {
         return(MessageEntityTool.GetMessage(ErrorType.FieldError, "", "坐标格式有误"));
     }
 }