Пример #1
0
 //�ظ�����鳵 ///////////////////////////////////////////
 private void C_Pos_RegionQuery(DataClient dataClient, String rec)
 {
     try
     {
         StringBuilder stb = new StringBuilder(Constant.HEAD).Append(Constant.C_POS).Append(Constant.C_POS_REGION_QUERY);
         String[] ss = rec.Split(Constant.SPLIT1);
         StringBuilder stbSql = new StringBuilder("select carID,lo,la from vPosition where gpsTime>='");
         stbSql.Append(ss[1]).Append("' and gpsTime<='").Append(ss[2]).Append("' ");
         if(ss[0] != "")
             stbSql.Append("and teamID=").Append(ss[0]);
         DataTable dt = dbm.ExecuteQuery(stbSql.ToString());
         if(dt != null && dt.Rows.Count > 0)
         {
             String cids = "";
             Region region = new Region(ss[3]);
             stb.Append(ss[1]).Append(Constant.SPLIT1).Append(ss[2]).Append(Constant.SPLIT1);
             foreach(DataRow dr in dt.Rows)
             {
                 String cid = dr[0].ToString();
                 if(cids.IndexOf(cid) >= 0)
                     continue;
                 else if(region.InRegion(new DPoint(Double.Parse(dr[1].ToString()), Double.Parse(dr[2].ToString()))))
                     cids = cids + cid + Constant.SPLIT1;
             }
             stb.Append(cids.Substring(0, cids.Length - 1));
         }
         stb.Append(Constant.FOOT);
         dataClient.Send(stb.ToString());
     }
     catch(Exception e)
     {
         if(FormMain.LOG_ERR)
             logger.AddErr(e, "");
     }
 }