Esempio n. 1
0
        protected override void OnStartup()
        {
            s_extension = this;
            Initialize();

            UID editorUID = new UID();

            editorUID.Value = "esriEditor.Editor";

            this.m_editor = ArcMap.Application.FindExtensionByCLSID(editorUID) as IEditor;

            Events.OnStartEditing += new IEditEvents_OnStartEditingEventHandler(Events_OnStartEditing);
            Events.OnStopEditing  += new IEditEvents_OnStopEditingEventHandler(Events_OnStopEditing);

            m_map = ArcMap.Document.FocusMap;

            try
            {
                if (CMedToolsSubs.ensureSettingsFile())
                {
                    setConstVals();
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show(SConst.OrganizationName + " GIS Error: settings not found");
                    //    //this.State = ExtensionState.Disabled;
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message, "STARTUP ERROR!", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        public void loadForm()
        {
            string sName = System.Environment.UserName; // WindowsIdentity.GetCurrent().Name;

            this.label1.Text = sName;

            ArrayList userLayers = null;

            //MessageBox.Show(CMedToolsSubs.getObjectProperty(sName, "givenName") + " --- " + CMedToolsSubs.getObjectProperty(sName, "SN"));

            if (SConst.GotDBConn)
            {
                using (CData oData = new CData(SConst.GISConnString.ToString()))
                {
                    userLayers = oData.getUserLayers(CMedToolsSubs.getObjectProperty(sName, "givenName"), CMedToolsSubs.getObjectProperty(sName, "SN"));
                }
            }

            if (userLayers != null)
            {
                lbEditabelLayers.Enabled = true;
                btnEdit.Enabled          = true;

                foreach (string item in userLayers)
                {
                    lbEditabelLayers.Items.Add(item.ToString());
                }
            }
            else
            {
                lbEditabelLayers.Items.Add("No layers are available for editing");
                lbEditabelLayers.Enabled = false;
                btnEdit.Enabled          = false;
            }
        }
Esempio n. 3
0
        private void fmAddLayers_Load(object sender, EventArgs e)
        {
            //if (!SConst.EnableEditorControl)
            //{
            //    tsbEditor.Visible = false;
            //}

            if (SConst.LayerLocation == null)
            {
                CMedToolsSubs.setConstVals();
            }
            else if (SConst.LayerLocation.Length < 1)
            {
                CMedToolsSubs.setConstVals();
            }

            lblInfo.Text = SConst.LayerLocation;

            try
            {
                tsbEditor.Visible = true;
                loadControls();
            }
            catch (Exception ex)
            {
                string s = ex.Message;
            }
        }
Esempio n. 4
0
 private void panel1_Paint(object sender, PaintEventArgs e)
 {
     try
     {
         foreach (Control ctl in panel1.Controls)
         {
             if (ctl is CheckBox)
             {
                 if (ctl.Tag != null)
                 {
                     //if (CConst.LayerExists(ctl.Tag.ToString()))
                     if (CMedToolsSubs.layerExists(ctl.Tag.ToString() + ".lyr", SConst.LayerLocation))
                     {
                         ctl.Enabled = true;
                     }
                     else
                     {
                         ctl.Enabled = false;
                     }
                 }
                 else
                 {
                     ctl.Enabled = false;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         string s = ex.Message;
         s += " - -- that was it";
     }
 }
Esempio n. 5
0
 private void panel1_Paint(object sender, PaintEventArgs e)
 {
     foreach (Control ctl in panel1.Controls)
     {
         if (ctl is CheckBox)
         {
             if (ctl.Tag != null)
             {
                 //if (CConst.LayerExists(ctl.Tag.ToString()))
                 if (CMedToolsSubs.layerExists(ctl.Tag.ToString() + ".lyr", SConst.LayerLocation))
                 {
                     ctl.Enabled = true;
                 }
                 else
                 {
                     ctl.Enabled = false;
                 }
             }
             else
             {
                 ctl.Enabled = false;
             }
         }
     }
 }
Esempio n. 6
0
        public fmTLSearch()
        {
            InitializeComponent();
            this.App = (IApplication)ArcMap.ThisApplication;

            if ((SConst.LayerLocation == null) || (SConst.LayerLocation.Length < 1))
            {
                CMedToolsSubs.setConstVals();
            }
        }
Esempio n. 7
0
        private Collection <string> getOnLayers(string sFilter)
        {
            Dictionary <string, string> dct      = CMedToolsSubs.returnConfigNode("Layer", sFilter, SConst.LayerSettingsLocation);
            Collection <string>         onLayers = new Collection <string>();

            foreach (KeyValuePair <string, string> pair in dct)
            {
                onLayers.Add(pair.Key);
            }
            return(onLayers);
        }
Esempio n. 8
0
        public void Startup(ref object initializationData)
        {
            try
            {
                if (CMedToolsSubs.ensureSettingsFile())
                {
                    //CMedToolsSubs.returnSettingValue("Task_User_Pwd", SConst.DataSettingsLocation).ToString();

                    m_pApplication = initializationData as IApplication;


                    Dictionary <string, string> dctMapLayers = new Dictionary <string, string>();
                    dctMapLayers = SConst.PlanningLayers;

                    //if (CMedToolsSubs.canConnect(SConst.LXConnString))
                    //    SConst.GotDBConn = true;
                    //else
                    //    SConst.GotDBConn = false;

                    // --------------------------
                    //  4-16-2008
                    //  DJR
                    //      -- added so that we can listen for OnSaveEdits editor event
                    //      -- begin changes
                    // --------------------------
                    UID editorUID = new UID();
                    editorUID.Value = "esriEditor.Editor";
                    if (m_pApplication == null)
                    {
                        return;
                    }


                    setConstVals();

                    // --------------------------
                    //      end changes
                    // --------------------------

                    //m_pExtState = esriExtensionState.esriESEnabled;
                    this.State = esriExtensionState.esriESEnabled;
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show(SConst.OrganizationName + " GIS Error: settings not found");
                    this.State = esriExtensionState.esriESDisabled;
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message, "STARTUP ERROR!", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
            }
        }
Esempio n. 9
0
        private void loadControls()
        {
            string sStartUpTab = CMedToolsSubs.readRegKey(Microsoft.Win32.Registry.LocalMachine, "SOFTWARE\\City of Medford", "AddLayersTab");   //SOFTWARE\\City of Medford

            Control ctl = returnNewControl(sStartUpTab);

            m_CurrentControl = ctl;

            ToolStripButton tsb = setToolStripButton(sStartUpTab);

            m_CurrentClickedButton = tsb;
            doButtonChange(tsb);
        }
Esempio n. 10
0
        private void setConstVals()
        {
            // set the location for the default layer location
            SConst.LayerLocation = CMedToolsSubs.returnSettingValue("Default_Layer_Location", SConst.DataSettingsLocation);

            //// set the flag that allows for City of Medford Specific content
            //SConst.EnableMedfordContent = Convert.ToBoolean(CMedToolsSubs.returnSettingValue("Enable_MedfordContent", SConst.DataSettingsLocation).ToString());

            //// set the flag that allows for City of Medford Specific content
            //SConst.EnableEditorControl = Convert.ToBoolean(CMedToolsSubs.returnSettingValue("Enable_EditorControl", SConst.DataSettingsLocation).ToString());

            // set the organization name
            SConst.OrganizationName = CMedToolsSubs.returnSettingValue("Organization_Name", SConst.DataSettingsLocation).ToString();
        }
Esempio n. 11
0
        private void fmAddLayers_Load(object sender, EventArgs e)
        {
            if (!SConst.EnableEditorControl)
            {
                tsbEditor.Visible = false;
            }

            string sStartUpTab = CMedToolsSubs.readRegKey(Microsoft.Win32.Registry.LocalMachine, "SOFTWARE\\City of Medford", "AddLayersTab");   //SOFTWARE\\City of Medford

            Control ctl = returnNewControl(sStartUpTab);

            m_CurrentControl = ctl;

            ToolStripButton tsb = setToolStripButton(sStartUpTab);

            m_CurrentClickedButton = tsb;
            doButtonChange(tsb);
        }
Esempio n. 12
0
        private void fmAddLayers_FormClosed(object sender, FormClosedEventArgs e)
        {
            string sTag = m_CurrentControl.Tag.ToString();

            try
            {
                CMedToolsSubs.writeRegKey(Microsoft.Win32.Registry.LocalMachine, "SOFTWARE\\City of Medford", "AddLayersTab", sTag);
            }
            catch
            {
                // just move on  ... don't throw an error
            }

            //this.Hide();
            if (SConst.m_pCheckedLayers != null)
            {
                SConst.m_pCheckedLayers.Clear();
            }
            this.Dispose();
        }
Esempio n. 13
0
        private void fmPrintMap_Load(object sender, EventArgs e)
        {
            if (!checkLayers())
            {
                this.Dispose();
                return;
            }

            if ((SConst.LayerLocation == null) || (SConst.LayerLocation.Length < 1))
            {
                CMedToolsSubs.setConstVals();
            }

            resetForm();
            //loadMapSize();
            loadOrientation();
            loadMapScale();
            loadMapLayers();
            loadPrinters();

            this.txtTitle.Focus();
        }
Esempio n. 14
0
        private void loadLayers(ref IMap pMap, Dictionary <string, string> dctLayers, Collection <string> colOnLayers)
        {
            Collection <string> colMissingLayers = new Collection <string>();
            CSpatialSubs        oSpatialSubs     = new CSpatialSubs();

            try
            {
                foreach (KeyValuePair <string, string> pair in dctLayers)
                {
                    if (CMedToolsSubs.layerExists(dctLayers[pair.Key].ToString(), "I://GIS//Layers//"))               // SConst.LayerLocation))
                    {
                        pMap.AddLayer(oSpatialSubs.returnLayer(dctLayers[pair.Key].ToString(), "I://GIS//Layers//")); //  SConst.LayerLocation));
                    }
                    else
                    {
                        colMissingLayers.Add(pair.Key);
                    }
                }

                for (int i = 0; i < pMap.LayerCount; i++)
                {
                    ILayer pLayer = pMap.get_Layer(i);
                    if (!colMissingLayers.Contains(pLayer.Name))
                    {
                        if (!colOnLayers.Contains(pLayer.Name))
                        {
                            pLayer.Visible = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                oSpatialSubs.Dispose();
            }
        }
Esempio n. 15
0
        public fmAddDataFrame()
        {
            InitializeComponent();

            this.App = ArcMap.ThisApplication as IApplication;

            if ((SConst.LayerLocation == null) || (SConst.LayerLocation.Length < 1))
            {
                CMedToolsSubs.setConstVals();
            }

            Dictionary <string, string> dctCommon = SConst.CommonLayers;

            this.m_commonLayers = new string[dctCommon.Keys.Count];
            dctCommon.Values.CopyTo(this.m_commonLayers, 0);

            //CConst.CommonLayers.Values.CopyTo(this.m_commonLayers, 0);

            this.m_EconOnLayers   = this.getOnLayers("@type='EconDev' and @state='ON'");     // this.getEconOnLayers();
            this.m_FireOnLayers   = this.getOnLayers("@type='Fire' and @state='ON'");        //this.getFireOnLayers();
            this.m_PlanOnLayers   = this.getOnLayers("@type='Planning' and @state='ON'");    //this.getPlanOnLayers();
            this.m_PWOnLayers     = this.getOnLayers("@type='PublicWorks' and @state='ON'"); //this.getPWOnLayers();
            this.m_PoliceOnLayers = this.getOnLayers("@type='Police' and @state='ON'");      //this.getPoliceOnLayers();
        }
Esempio n. 16
0
        private void closeForm()
        {
            if (BoundariesPanel != null)
            {
                BoundariesPanel = null;
            }

            if (CensusPanel != null)
            {
                CensusPanel = null;
            }

            if (EmergencyPanel != null)
            {
                EmergencyPanel = null;
            }

            if (EnvironmentPanel != null)
            {
                EnvironmentPanel = null;
            }

            if (InfrastructPanel != null)
            {
                InfrastructPanel = null;
            }

            if (PhotoPanel != null)
            {
                PhotoPanel = null;
            }

            if (ServiceDistrictsPanel != null)
            {
                ServiceDistrictsPanel = null;
            }

            if (SoilsTopoPanel != null)
            {
                SoilsTopoPanel = null;
            }

            if (StructuresPanel != null)
            {
                StructuresPanel.Dispose();
            }

            if (TaxlotsPanel != null)
            {
                TaxlotsPanel = null;
            }

            if (TransportationPanel != null)
            {
                TransportationPanel = null;
            }

            if (WaterPanel != null)
            {
                WaterPanel = null;
            }

            if (ZoningPanel != null)
            {
                ZoningPanel = null;
            }

            if (UtilityPanel != null)
            {
                UtilityPanel = null;
            }

            if (EditorPanel != null)
            {
                EditorPanel = null;
            }

            if (MapServicePanel != null)
            {
                MapServicePanel = null;
            }

            string sTag = m_CurrentControl.Tag.ToString();

            try
            {
                CMedToolsSubs.writeRegKey(Microsoft.Win32.Registry.LocalMachine, "SOFTWARE\\City of Medford", "AddLayersTab", sTag);
            }
            catch (Exception ex)
            {
                // just move on  ... don't throw an error
            }

            //CAddLayers oAddLayers = new CAddLayers();
            //oAddLayers.closeForm();

            this.Close();
            this.Dispose();

            //reloadForm();
        }
Esempio n. 17
0
        public override void setConstants()
        {
            try
            {
                Dictionary <string, string> dctLandscapeSettings = CMedToolsSubs.returnSettingsNodes(SConst.PrintSettingsLocation, "//LandscapePrintSetting");

                SPrintConst.Neatline_XMin         = Double.Parse(dctLandscapeSettings["Landscape_NeatLineXMin"].ToString());
                SPrintConst.Neatline_XMax         = Double.Parse(dctLandscapeSettings["Landscape_NeatLineXMax"].ToString());
                SPrintConst.Neatline_YMin         = Double.Parse(dctLandscapeSettings["Landscape_NeatLineYMin"].ToString());
                SPrintConst.Neatline_YMax         = Double.Parse(dctLandscapeSettings["Landscape_NeatLineYMax"].ToString());
                SPrintConst.MapFrame_XMin         = Double.Parse(dctLandscapeSettings["Landscape_MapFrameXMin"].ToString());
                SPrintConst.MapFrame_XMax         = Double.Parse(dctLandscapeSettings["Landscape_MapFrameXMax"].ToString());
                SPrintConst.MapFrame_YMin         = Double.Parse(dctLandscapeSettings["Landscape_MapFrameYMin"].ToString());
                SPrintConst.MapFrame_YMax         = Double.Parse(dctLandscapeSettings["Landscape_MapFrameYMax"].ToString());
                SPrintConst.Logo_Offset           = Double.Parse(dctLandscapeSettings["Landscape_LogoOffset"].ToString());
                SPrintConst.MapScaleText_Offset   = Double.Parse(dctLandscapeSettings["Landscape_MapscaleTextOffset"].ToString());
                SPrintConst.NameDate_Offset       = Double.Parse(dctLandscapeSettings["Landscape_NameDateOffset"].ToString());
                SPrintConst.Title_XOffset         = Double.Parse(dctLandscapeSettings["Landscape_TitleXOffset"].ToString());
                SPrintConst.Legend_YMax           = Double.Parse(dctLandscapeSettings["Landscape_LegendYMax"].ToString());
                SPrintConst.MaxLengendHeight      = Double.Parse(dctLandscapeSettings["Landscape_MaxLegendHeight"].ToString());
                SPrintConst.RightOfTitleLine_X    = 1;
                SPrintConst.LeftLine_X            = 1;
                SPrintConst.CenterLine_Y          = Double.Parse(dctLandscapeSettings["Landscape_CenterLineY"].ToString());;
                SPrintConst.Scalebar_XMax         = Double.Parse(dctLandscapeSettings["Landscape_ScalebarXMax"].ToString());
                SPrintConst.Scalebar_XMin         = Double.Parse(dctLandscapeSettings["Landscape_ScalebarXMin"].ToString());
                SPrintConst.Scalebar_YMax         = Double.Parse(dctLandscapeSettings["Landscape_ScalebarYMax"].ToString());
                SPrintConst.Scalebar_YMin         = Double.Parse(dctLandscapeSettings["Landscape_ScalebarYMin"].ToString());
                SPrintConst.MapscaleText_XMin     = Double.Parse(dctLandscapeSettings["Landscape_MapscaleText_XMin"].ToString());
                SPrintConst.MapscaleText_XMax     = Double.Parse(dctLandscapeSettings["Landscape_MapscaleText_XMax"].ToString());
                SPrintConst.MapscaleText_YMin     = Double.Parse(dctLandscapeSettings["Landscape_MapscaleText_YMin"].ToString());
                SPrintConst.MedfordRectangle_YMin = Double.Parse(dctLandscapeSettings["Landscape_MedfordRectangle_YMin"].ToString());
                SPrintConst.MedfordText_XMin      = Double.Parse(dctLandscapeSettings["Landscape_MedfordText_XMin"].ToString());
                SPrintConst.MedfordText_XMax      = Double.Parse(dctLandscapeSettings["Landscape_MedfordText_XMax"].ToString());
                SPrintConst.MedfordText_YMin      = Double.Parse(dctLandscapeSettings["Landscape_MedfordText_YMin"].ToString());
                SPrintConst.MedfordText_YMax      = Double.Parse(dctLandscapeSettings["Landscape_MedfordText_YMax"].ToString());
                SPrintConst.MedGISText_XMax       = Double.Parse(dctLandscapeSettings["Landscape_MedGISText_XMax"].ToString());
                SPrintConst.MedGISText_XMin       = Double.Parse(dctLandscapeSettings["Landscape_MedGISText_XMin"].ToString());
                SPrintConst.MedGISText_YMax       = Double.Parse(dctLandscapeSettings["Landscape_MedGISText_YMax"].ToString());
                SPrintConst.MedGISText_YMin       = Double.Parse(dctLandscapeSettings["Landscape_MedGISText_YMin"].ToString());
                SPrintConst.Disclaimer_XMin       = Double.Parse(dctLandscapeSettings["Landscape_Disclaimer_XMin"].ToString());
                SPrintConst.Disclaimer_XMax       = Double.Parse(dctLandscapeSettings["Landscape_Disclaimer_XMax"].ToString());
                SPrintConst.Disclaimer_YMin       = Double.Parse(dctLandscapeSettings["Landscape_Disclaimer_YMin"].ToString());
                SPrintConst.Disclaimer_YMax       = Double.Parse(dctLandscapeSettings["Landscape_Disclaimer_YMax"].ToString());
                SPrintConst.Recycle_YMin          = Double.Parse(dctLandscapeSettings["Landscape_Recycle_YMin"].ToString());
                SPrintConst.Recycle_HeightWidth   = Double.Parse(dctLandscapeSettings["Landscape_Recycle_HeightWidth"].ToString());
                SPrintConst.Recycle_ImagePath     = dctLandscapeSettings["Landscape_Recycle_ImagePath"].ToString();
                SPrintConst.Logo_Image            = dctLandscapeSettings["Landscape_Logo_Image"].ToString();
                SPrintConst.Logo_XMin             = Double.Parse(dctLandscapeSettings["Landscape_Logo_XMin"].ToString());
                SPrintConst.Logo_YMin             = Double.Parse(dctLandscapeSettings["Landscape_Logo_YMin"].ToString());
                SPrintConst.Logo_Height           = Double.Parse(dctLandscapeSettings["Landscape_Logo_Height"].ToString());
                SPrintConst.Logo_Width            = Double.Parse(dctLandscapeSettings["Landscape_Logo_Width"].ToString());
                SPrintConst.NorthArrow_Character  = Double.Parse(dctLandscapeSettings["Landscape_NorthArrow_Character"].ToString());
                SPrintConst.NorthArrow_Height     = Double.Parse(dctLandscapeSettings["Landscape_NorthArrow_Height"].ToString());
                SPrintConst.NorthArrow_Size       = Double.Parse(dctLandscapeSettings["Landscape_NorthArrow_Size"].ToString());
                SPrintConst.NorthArrow_Width      = Double.Parse(dctLandscapeSettings["Landscape_NorthArrow_Width"].ToString());
                SPrintConst.NorthArrow_XMax       = Double.Parse(dctLandscapeSettings["Landscape_NorthArrow_XMax"].ToString());
                SPrintConst.NorthArrow_XMin       = Double.Parse(dctLandscapeSettings["Landscape_NorthArrow_XMin"].ToString());
                SPrintConst.NorthArrow_YMax       = Double.Parse(dctLandscapeSettings["Landscape_NorthArrow_YMax"].ToString());
                SPrintConst.NorthArrow_YMin       = Double.Parse(dctLandscapeSettings["Landscape_NorthArrow_YMin"].ToString());
                SPrintConst.Title_XMax            = Double.Parse(dctLandscapeSettings["Landscape_Title_XMax"].ToString());
                SPrintConst.Title_YMax            = Double.Parse(dctLandscapeSettings["Landscape_Title_YMax"].ToString());
                SPrintConst.Title_XMin            = Double.Parse(dctLandscapeSettings["Landscape_Title_XMin"].ToString());
                SPrintConst.Title_YMin            = Double.Parse(dctLandscapeSettings["Landscape_Title_YMin"].ToString());
                SPrintConst.Subtitle_XMax         = Double.Parse(dctLandscapeSettings["Landscape_Subtitle_XMax"].ToString());
                SPrintConst.Subtitle_YMax         = Double.Parse(dctLandscapeSettings["Landscape_Subtitle_YMax"].ToString());
                SPrintConst.Subtitle_XMin         = Double.Parse(dctLandscapeSettings["Landscape_Subtitle_XMin"].ToString());
                SPrintConst.Subtitle_YMin         = Double.Parse(dctLandscapeSettings["Landscape_Subtitle_YMin"].ToString());
                SPrintConst.Legend_Height         = Double.Parse(dctLandscapeSettings["Landscape_Legend_Height"].ToString());
                SPrintConst.Legend_Width          = Double.Parse(dctLandscapeSettings["Landscape_Legend_Width"].ToString());
                SPrintConst.Legend_XMin           = Double.Parse(dctLandscapeSettings["Landscape_Legend_XMin"].ToString());
                SPrintConst.Legend_YMin           = Double.Parse(dctLandscapeSettings["Landscape_Legend_YMin"].ToString());
                SPrintConst.Name_XMax             = Double.Parse(dctLandscapeSettings["Landscape_NameXMax"].ToString());
                SPrintConst.Name_XMin             = Double.Parse(dctLandscapeSettings["Landscape_NameXMin"].ToString());
                SPrintConst.Name_YMax             = Double.Parse(dctLandscapeSettings["Landscape_NameYMax"].ToString());
                SPrintConst.Name_YMin             = Double.Parse(dctLandscapeSettings["Landscape_NameYMin"].ToString());

                dctLandscapeSettings = null;
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("Errors: CLandscapeLayout:setConstants()\r\n" + ex.Message, "Errors occurred", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
            }
        }
Esempio n. 18
0
        private void fmSearchResults_Shown(object sender, EventArgs e)
        {
            try
            {
                m_bShowHTE = false;
                this.setHTEVisibility();

                this.Cursor = Cursors.WaitCursor;

                //Application.DoEvents();

                ESRI.ArcGIS.ArcMapUI.IMxDocument pMxDoc = (ESRI.ArcGIS.ArcMapUI.IMxDocument) this.App.Document;
                IMap          pMap = (IMap)pMxDoc.FocusMap;
                IFeatureLayer pLayer;

                using (CSpatialSubs oSpatialSubs = new CSpatialSubs())
                {
                    pLayer = (IFeatureLayer)oSpatialSubs.returnFeatureLayer(pMap, SConst.Taxlots);
                }

                ICursor pCurs;

                IFeatureSelection pFSel = (IFeatureSelection)pLayer;
                pFSel.SelectionSet.Search(null, true, out pCurs);

                IFeatureCursor pFCurs = (IFeatureCursor)pCurs;
                IFeature       pFeat  = pFCurs.NextFeature();

                //Application.DoEvents();

                decimal dImpVal  = decimal.Parse(pFeat.get_Value(pFeat.Fields.FindField("IMPVALUE")).ToString());
                decimal dLandVal = decimal.Parse(pFeat.get_Value(pFeat.Fields.FindField("LANDVALUE")).ToString());

                lblAcctNumber.Text   = pFeat.get_Value(pFeat.Fields.FindField("ACCOUNT")).ToString();
                lblFeeOwner.Text     = pFeat.get_Value(pFeat.Fields.FindField("FEEOWNER")).ToString();
                lblImpValue.Text     = (dImpVal).ToString("C");
                lblLandValue.Text    = (dLandVal).ToString("C");
                lblMailingAddr.Text  = pFeat.get_Value(pFeat.Fields.FindField("ADDRESS1")).ToString();
                lblMailingAddr2.Text = pFeat.get_Value(pFeat.Fields.FindField("CITY")).ToString() + "," + pFeat.get_Value(pFeat.Fields.FindField("STATE")).ToString() + " " + pFeat.get_Value(pFeat.Fields.FindField("ZIPCODE")).ToString();
                lblMaplotNumber.Text = pFeat.get_Value(pFeat.Fields.FindField("MAPLOT")).ToString();
                //lblSitusAddr.Text = pFeat.get_Value(pFeat.Fields.FindField("ADDRESSNUM")).ToString() + " " + pFeat.get_Value(pFeat.Fields.FindField("STREETNAME")).ToString();
                lblLocID.Text = this.LocationID.ToString();

                lblPropClass.Text     = pFeat.get_Value(pFeat.Fields.FindField("PROPCLASS")).ToString();
                lblPropClassDesc.Text = CMedToolsSubs.returnPropClassDescription(pFeat.get_Value(pFeat.Fields.FindField("PROPCLASS")).ToString(), CMedToolsSubs.getPropClass());

                string sFormattedTaxCode = CMedToolsSubs.returnTaxCodeFormatted(pFeat.get_Value(pFeat.Fields.FindField("TAXCODE")).ToString());

                lblTaxcode.Text = sFormattedTaxCode;
                string[] aTaxCodeInfo = CMedToolsSubs.returnTaxCodeInfo(sFormattedTaxCode, CMedToolsSubs.getTaxCodes());

                if (aTaxCodeInfo != null)
                {
                    lblTaxCodeCity.Text       = aTaxCodeInfo[0].ToString();
                    lblTaxCodeSchool.Text     = aTaxCodeInfo[1].ToString();
                    lblTaxCodeWater.Text      = aTaxCodeInfo[2].ToString();
                    lblTaxCodeUrbanRenew.Text = aTaxCodeInfo[3].ToString();
                    lblTaxCodeFireDist.Text   = aTaxCodeInfo[4].ToString();
                }
                else
                {
                    lblTaxCodeCity.Text       = "";
                    lblTaxCodeSchool.Text     = "";
                    lblTaxCodeWater.Text      = "";
                    lblTaxCodeUrbanRenew.Text = "";
                    lblTaxCodeFireDist.Text   = "";
                }

                //getLXInfo(pFeat.get_Value(pFeat.Fields.FindField("ACCOUNT")).ToString(), pFeat.get_Value(pFeat.Fields.FindField("MAPNUM")).ToString(), pFeat.get_Value(pFeat.Fields.FindField("TAXLOT")).ToString());

                //Application.DoEvents();

                if (this.LocationID < 1)
                {
                    if (SConst.GotDBConn)
                    {
                        // this should be a Medford Address
                        using (CData oData = new CData(SConst.LXConnString.ToString()))
                        {
                            lblSitusAddr.Text = oData.returnSitusAddressByLocID(this.LocationID);
                        }
                    }
                    //else
                    //tabControl1.Enabled = false;
                }
                else
                {
                    // this should be a county address
                    lblSitusAddr.Text = pFeat.get_Value(pFeat.Fields.FindField("ADDRESSNUM")).ToString() + " " + pFeat.get_Value(pFeat.Fields.FindField("STREETNAME")).ToString();
                    //tabControl1.Enabled = false;
                }

                this.Cursor = Cursors.Default;
                //Application.DoEvents();
            }
            catch (Exception ex)
            {
                string s = ex.Message;
                s += "- --- that was it";
            }
        }
Esempio n. 19
0
        private void btnViewDetails_Click(object sender, EventArgs e)
        {
            try
            {
                if (dgvResults.SelectedRows.Count == 1)
                {
                    this.Hide();

                    string sAddNum = dgvResults.SelectedRows[0].Cells["ADDRESSNUM"].Value.ToString();
                    if (sAddNum.IndexOf(" ") > 0)
                    {
                        sAddNum = sAddNum.Substring(0, sAddNum.IndexOf(" "));
                    }
                    string sStreet     = dgvResults.SelectedRows[0].Cells["STREETNAME"].Value.ToString();
                    object oLocResults = new object();

                    //if (CMedToolsSubs.canConnect(CConst.LXConnString))
                    if (SConst.GotDBConn)
                    {
                        using (CData oData = new CData(SConst.LXConnString.ToString()))
                        {
                            oLocResults = oData.returnLocID(sAddNum, CMedToolsSubs.returnStreetDirectionFromTaxlotsAddress(sStreet), CMedToolsSubs.returnStreetNameFromTaxlotsAddress(sStreet, SConst.CountyStreets), CMedToolsSubs.returnStreetTypeFromTaxlotsAddress(sStreet, SConst.CountyStreets), dgvResults.SelectedRows[0].Cells["MAPLOT"].Value.ToString(), dgvResults.SelectedRows[0].Cells["ACCOUNT"].Value.ToString());
                        }
                    }
                    else
                    {
                        oLocResults = null;
                    }

                    if (oLocResults is Hashtable)
                    {
                        fmSubAccount oSubAccount = new fmSubAccount();
                        oSubAccount.App         = this.App;
                        oSubAccount.ObjectID    = dgvResults.SelectedRows[0].Cells["OBJECTID"].Value.ToString();
                        oSubAccount.SubAccounts = oLocResults as Hashtable;
                        oSubAccount.Show(new WindowWrapper((System.IntPtr)m_pApp.hWnd));
                    }
                    else
                    {
                        fmSearchResults oSearchResults = new fmSearchResults();
                        oSearchResults.ObjectID = dgvResults.SelectedRows[0].Cells["OBJECTID"].Value.ToString();
                        oSearchResults.App      = this.App;
                        if (oLocResults != null)
                        {
                            oSearchResults.LocationID = (int)oLocResults;
                        }
                        else
                        {
                            oSearchResults.LocationID = 0;
                        }
                        oSearchResults.Show(new WindowWrapper((System.IntPtr)m_pApp.hWnd));
                    }
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Please select one row in the grid.", "Taxlot Search: Selection Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Errors occurred: \r\n\r\n" + ex.Message);
                this.Dispose();
            }
        }
Esempio n. 20
0
        private void getResults(string sWhere)
        {
            CSpatialSubs oSpatialSubs = new CSpatialSubs();
            object       oResults     = oSpatialSubs.searchTaxlots(sWhere, m_pApp);

            try
            {
                if (oResults is IFeatureCursor)
                {
                    // this means that there were multiple results returned
                    // from the user search criteria
                    // so ... show the multiple results window
                    this.Hide();

                    // show multiple results
                    fmMultipleResults oMultRes = new fmMultipleResults();
                    oMultRes.SearchResults = (IFeatureCursor)oResults;
                    oMultRes.App           = this.m_pApp;
                    oMultRes.Show(new WindowWrapper((System.IntPtr)m_pApp.hWnd));

                    this.Dispose();
                }
                else
                {
                    // this means that there was only one feature returned from
                    // the user search criteria

                    IFeature pFeat = (IFeature)oResults;
                    if (pFeat != null)
                    {
                        // zoom to table
                        this.Hide();

                        string sAccount = oSpatialSubs.returnValueFromSingleSelection("ACCOUNT", this.App, SConst.Taxlots);
                        string sMaplot  = oSpatialSubs.returnValueFromSingleSelection("MAPLOT", this.App, SConst.Taxlots);
                        string sAddNum  = oSpatialSubs.returnValueFromSingleSelection("ADDRESSNUM", this.App, SConst.Taxlots);
                        if (sAddNum.IndexOf(" ") > 0)
                        {
                            sAddNum = "";
                        }
                        string sStreet     = oSpatialSubs.returnValueFromSingleSelection("STREETNAME", this.App, SConst.Taxlots);
                        string sObjectID   = oSpatialSubs.returnValueFromSingleSelection("OBJECTID", this.App, SConst.Taxlots);
                        object oLocResults = new object();

                        // go get the location id and check for subaccounts

                        //if (CMedToolsSubs.canConnect(CConst.LXConnString))
                        if (SConst.GotDBConn)
                        {
                            using (CData oData = new CData(SConst.LXConnString.ToString()))
                            {
                                string sDir        = CMedToolsSubs.returnStreetDirectionFromTaxlotsAddress(sStreet);
                                string sStreetName = CMedToolsSubs.returnStreetNameFromTaxlotsAddress(sStreet, SConst.CountyStreets);
                                string sStreetType = CMedToolsSubs.returnStreetTypeFromTaxlotsAddress(sStreet, SConst.CountyStreets);
                                oLocResults = oData.returnLocID(sAddNum, sDir, sStreetName, sStreetType, sMaplot, sAccount);
                            }
                        }
                        else
                        {
                            oLocResults = null;
                        }

                        if (oLocResults is Hashtable)
                        {
                            // the hashtable means that there are multiple subaccounts
                            // so ... go to the sub account window
                            fmSubAccount oSubAccount = new fmSubAccount();
                            oSubAccount.App         = this.App;
                            oSubAccount.ObjectID    = sObjectID;
                            oSubAccount.SubAccounts = oLocResults as Hashtable;
                            oSubAccount.Show(new WindowWrapper((System.IntPtr)m_pApp.hWnd));
                        }
                        else
                        {
                            // there is only one account here ...
                            // so ... go to the results
                            fmSearchResults oSearchResults = new fmSearchResults();
                            oSearchResults.ObjectID = sObjectID;
                            oSearchResults.App      = this.App;
                            if (oLocResults != null)
                            {
                                oSearchResults.LocationID = (int)oLocResults;
                            }
                            else
                            {
                                oSearchResults.LocationID = 0;
                            }
                            oSearchResults.Show(new WindowWrapper((System.IntPtr)m_pApp.hWnd));
                        }
                        this.Dispose();
                    }
                    else
                    {
                        MessageBox.Show("There were no matches found.", "Taxlot Search: Results", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        // reset the form
                    }
                }
            }
            catch (Exception ex)
            {
                string s = ex.Message;
                s += "done";
            }
            finally
            {
                oSpatialSubs.Dispose();
            }
        }