private void cmdFind_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; //Run_FindCipByNumber(txtCipNumber.Text); //added by rob to modularize code commonsubs comSub = new commonsubs(); comSub.FindByString("CIP_ID = '" + txtCipNumber.Text + "'", "ProjectID"); this.Cursor = Cursors.Default; this.Close(); }
private void btnFind_Click(object sender, EventArgs e) { if (txtThomasBrothersPage.Text == " " || txtThomasBrothersColumn.Text == " " || txtThomasBrothersRow.Text == " ") { MessageBox.Show("Invalid Thomas Brothers Page, Row, or Column Entered.", "Error On Search"); } else { this.Cursor = Cursors.WaitCursor; IFeatureLayer pFL; commonsubs comSub = new commonsubs(); IMxDocument pMxDoc = ArcMap.Document; IMap pMap = pMxDoc.FocusMap; ILayer player = null; string swhere = ""; string ermsg = ""; //Determine if it is the page or the tile if (txtThomasBrothersColumn.Text == "" && txtThomasBrothersRow.Text == "") { player = comSub.LoopThroughLayersOfSpecificUID(pMap, "{40A9E885-5533-11D0-98BE-00805F7CED21}", "SANGIS.GRID_PAGE_TB"); swhere = "PAGE = '" + txtThomasBrothersPage.Text + "'"; ermsg = "The Page entered was now found"; } else { player = comSub.LoopThroughLayersOfSpecificUID(pMap, "{40A9E885-5533-11D0-98BE-00805F7CED21}", "SANGIS.GRID_TILE_TB"); swhere = "PAGE = '" + txtThomasBrothersPage.Text + "' AND ROW_ = '" + txtThomasBrothersRow.Text + "' AND COLUMN_ = '" + txtThomasBrothersColumn.Text.ToUpper() + "'"; ermsg = "The Page, Column, and Row combination entered was now found"; } //Run the search int selcount = 0; IEnvelope pEnvelope = new EnvelopeClass(); pEnvelope.SetEmpty(); if (player != null) { pFL = player as IFeatureLayer; selcount = comSub.SelectMapFeaturesByAttributeQuery(pMxDoc.ActiveView, pFL, swhere); if (selcount > 0) { player.Visible = true; comSub.zoomtoselected(player, pEnvelope); System.Diagnostics.Debug.WriteLine(player.Name); } else { MessageBox.Show(ermsg, "Please try another selection"); } } ResetTBForm(); this.Cursor = Cursors.Default; } }
private void cmdFind_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; //Run_FindGroupJobByName(txtCipName.Text); //added by rob to modularize code commonsubs comSub = new commonsubs(); comSub.FindByString("TITLE = '" + txtCipName.Text + "'", "Project Title"); this.Cursor = Cursors.Default; this.Close(); }
private void btnFind_Click(object sender, EventArgs e) { commonsubs comSub = new commonsubs(); IMxDocument pMxDoc = ArcMap.Document; IMap pMap = pMxDoc.FocusMap; IFeatureLayer pFL; int selcount = 0; IEnvelope pEnvelope = new EnvelopeClass(); pEnvelope.SetEmpty(); ILayer player = comSub.LoopThroughLayersOfSpecificUID(pMap, "{40A9E885-5533-11D0-98BE-00805F7CED21}", "SANGIS.GRID_SANGIS"); if (player != null) { pFL = player as IFeatureLayer; selcount = comSub.SelectMapFeaturesByAttributeQuery(pMxDoc.ActiveView, pFL, "FLD_BK_PG = '" + txtFBP.Text.ToUpper() + "'"); if (selcount > 0) { comSub.zoomtoselected(player, pEnvelope, cboQuardrant.Text); System.Diagnostics.Debug.WriteLine(player.Name); } } }
protected override void OnSelChange(int cookie) { //Look for the layers needed for each search. //Needs to be run on each selection change in case layers are loaded after mxd loads //broken out into each layer boolean so that code can be added to physically add the specific layer later commonsubs comSub = new commonsubs(); IMxDocument pMxDoc = ArcMap.Document; IMap pMap = pMxDoc.FocusMap; bool CIPPointLayer = false; bool CIPLineLayer = false; bool CIPPolyLayer = false; bool FieldBookLayer = false; bool TBPageLayer = false; bool TBTileLayer = false; if (comSub.LoopThroughLayersOfSpecificUID(pMap, "{40A9E885-5533-11D0-98BE-00805F7CED21}", "SANGIS.CIP_POINT") != null) { CIPPointLayer = true; } if (comSub.LoopThroughLayersOfSpecificUID(pMap, "{40A9E885-5533-11D0-98BE-00805F7CED21}", "SANGIS.CIP_LINE") != null) { CIPLineLayer = true; } if (comSub.LoopThroughLayersOfSpecificUID(pMap, "{40A9E885-5533-11D0-98BE-00805F7CED21}", "SANGIS.CIP_POLY") != null) { CIPPolyLayer = true; } if (comSub.LoopThroughLayersOfSpecificUID(pMap, "{40A9E885-5533-11D0-98BE-00805F7CED21}", "SANGIS.GRID_SANGIS") != null) { FieldBookLayer = true; } if (comSub.LoopThroughLayersOfSpecificUID(pMap, "{40A9E885-5533-11D0-98BE-00805F7CED21}", "SANGIS.GRID_PAGE_TB") != null) { TBPageLayer = true; } if (comSub.LoopThroughLayersOfSpecificUID(pMap, "{40A9E885-5533-11D0-98BE-00805F7CED21}", "SANGIS.GRID_TILE_TB") != null) { TBTileLayer = true; } //string strSelected = null; foreach (ComboBox.Item item in this.items) { //Debug.WriteLine(cookie.ToString() + " " + item.Tag); if (item.Cookie == cookie) { //strSelected = item.Caption; switch (item.Caption) { case "ECP Project Title": { if (!CIPLineLayer || !CIPPointLayer || !CIPPolyLayer) { System.Windows.Forms.MessageBox.Show("The CIP Point, Line, or Polygon Layer is missing from the TOC, Please add it to use this search"); } else { frmGroupJob frmgroupJob = new frmGroupJob(); frmgroupJob.TopMost = true; frmgroupJob.Show(); } break; } case "ECP Project Number": { if (!CIPLineLayer || !CIPPointLayer || !CIPPolyLayer) { System.Windows.Forms.MessageBox.Show("The CIP Point, Line, or Polygon Layer is missing from the TOC, Please add it to use this search"); } else { frmCipNumber frmNum = new frmCipNumber(); frmNum.TopMost = true; frmNum.Show(); } break; } case "Fieldbook Page": { if (!FieldBookLayer) { System.Windows.Forms.MessageBox.Show("The Field Book Layer is missing from the TOC, Please add it to use this search"); } else { frmFieldBook frmFld = new frmFieldBook(); frmFld.TopMost = true; frmFld.Show(); } break; } case "Thomas Brothers Page": { if (!TBPageLayer || !TBTileLayer) { System.Windows.Forms.MessageBox.Show("The Thomas Brothers Page or Tile Layer is missing from the TOC, Please add it to use this search"); } else { frmThomasBrothers frmTB = new frmThomasBrothers(); frmTB.TopMost = true; frmTB.Show(); } break; } } } } //MessageBox.Show(cookie.ToString(), "Message", MessageBoxButtons.YesNoCancel); }