Пример #1
0
 private void updCarPlace(int iType, ThreeStateTreeNode node)
 {
     try
     {
         string showText = string.Empty;
         if (!Variable.sJGShowCar.Equals("0"))
         {
             string reg = "[\u4e00-\u9fa5][A-Z][A-Z0-9]{5}$";
             if (Variable.sJGShowCar.Equals("1"))
             {
                 showText = new Regex(reg).Replace(node.CarNum, "").TrimEnd(new char[]{' ', '-'});
             }
             else
             {
                 showText = new Regex(reg).Match(node.CarNum).Value;
             }
         }
         if (string.IsNullOrEmpty(showText))
         {
             showText = node.CarNum;
         }
         if (iType == 0)
         {
             MainForm.myMap.excuteSpatialQueryById(node.CarId, node.Longitude, node.Latitude);
         }
         else if (iType == 1)
         {
             node.SetNodeText(string.Format("{0}({1})", showText, node.Place));
             ThreeStateTreeNode node2 = this.tvTrackCar.getNodeById(node.CarId);
             if (node2 != null)
             {
                 node2.SetNodeText(string.Format("{0}({1})", showText, node.Place));
             }
             node2 = null;
         }
     }
     catch (Exception exception)
     {
         if (Variable.bLogin)
         {
             Record.execFileRecord("设置车辆位置信息updCarPlace", exception.Message);
         }
     }
 }