private void cmbDistrict1_SelectedValueChanged(object sender, EventArgs e)
        {
            int num = Convert.ToInt32(((ComBox)sender).Tag);

            if (num < 3)
            {
                ComBox box = this.grpDistrict.Controls[string.Format("cmbDistrict{0}", num)] as ComBox;
                if (this.grpDistrict.Controls[string.Format("cmbDistrict{0}", num + 1)] != null)
                {
                    ComBox box2 = this.grpDistrict.Controls[string.Format("cmbDistrict{0}", num + 1)] as ComBox;
                    if (box2 != null)
                    {
                        box2.clearItems();
                        if (box.SelectedIndex > 0)
                        {
                            object regionNames = GisService.GetRegionNames(box.SelectedValue.ToString());
                            if (regionNames != null)
                            {
                                string[] strArray = regionNames as string[];
                                box2.addItems("请选择行政区", "");
                                foreach (string str in strArray)
                                {
                                    string[] strArray2 = str.Split(new char[] { ':' });
                                    if (strArray2.Length >= 2)
                                    {
                                        box2.addItems(strArray2[1], strArray2[0]);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #2
0
 public void SetCarPlace()
 {
     try
     {
         for (int i = 0; i < this.dtText.Rows.Count; i++)
         {
             DataRow row = this.dtText.Rows[i];
             string str = row["Longitude"].ToString();
             string sLat = row["Latitude"].ToString();
             if (!string.IsNullOrEmpty(str))
             {
                 try
                 {
                     row["CurrentAddress"] = GisService.QueryAllLayerByPoint(str, sLat);
                 }
                 catch
                 {
                 }
             }
         }
     }
     catch (Exception exception)
     {
         Record.execFileRecord("文本位置->获取详细地址", exception.Message);
     }
 }
Exemple #3
0
 /// <inheritdoc />
 public GisHub(GisService gisService)
 {
     _gisService = gisService;
 }
 private void initDistrict()
 {
     try
     {
         this.cmbDistrict1.clearItems();
         this.cmbDistrict1.addItems("请选择行政区", "");
         object regionNames = GisService.GetRegionNames("");
         if (regionNames != null)
         {
             string[] strArray = regionNames as string[];
             foreach (string str in strArray)
             {
                 string[] strArray2 = str.Split(new char[] { ':' });
                 if (strArray2.Length >= 2)
                 {
                     this.cmbDistrict1.addItems(strArray2[1], strArray2[0]);
                 }
             }
             try
             {
                 DataTable table = RemotingClient.ExecSql(string.Format("exec GpsPicServer_FindAdminRegoionAlarm {0}", base.sCarSimNum));
                 if ((table != null) && (table.Rows.Count > 0))
                 {
                     string   str2      = table.Rows[0]["AlarmStatus"].ToString();
                     string[] strArray3 = table.Rows[0]["AdminRegionId"].ToString().Split(new char[] { '/' });
                     if ("0".Equals(str2))
                     {
                         this.rdoIn.Checked = true;
                     }
                     else
                     {
                         this.rdoOut.Checked = true;
                     }
                     string str4  = "";
                     int    index = 0;
                     while (index <= strArray3.Length)
                     {
                         if (!string.IsNullOrEmpty(str4))
                         {
                             str4 = str4 + "/";
                         }
                         str4 = str4 + strArray3[index];
                         index++;
                         ComBox sender = this.grpDistrict.Controls[string.Format("cmbDistrict{0}", index)] as ComBox;
                         if (sender == null)
                         {
                             return;
                         }
                         sender.SelectedValue = str4;
                         this.cmbDistrict1_SelectedValueChanged(sender, new EventArgs());
                     }
                 }
             }
             catch
             {
             }
         }
     }
     catch (Exception exception)
     {
         Record.execFileRecord(string.Format("{0}-初始化行政区域", base.OrderCode.ToString()), exception.Message);
     }
 }