Example #1
0
        public void DeleteContactsAndFaults(ContactsAndFault theContactsAndFault)
        {
            try { m_ContactsAndFaultsDictionary.Remove(theContactsAndFault.ContactsAndFaults_ID); }
            catch { }

            IEditor theEditor = ArcMap.Editor;

            if (theEditor.EditState == esriEditState.esriStateNotEditing)
            {
                theEditor.StartEditing(m_theWorkspace);
            }
            theEditor.StartOperation();

            try
            {
                IQueryFilter QF = new QueryFilterClass();
                QF.WhereClause = "ContactsAndFaults_ID = '" + theContactsAndFault.ContactsAndFaults_ID + "'";

                ITable ContactsAndFaultsTable = m_ContactsAndFaultsFC as ITable;
                ContactsAndFaultsTable.DeleteSearchedRows(QF);

                theEditor.StopOperation("Delete ContactsAndFaults");
            }
            catch (Exception e) { theEditor.StopOperation("ContactsAndFaults Management Failure"); }
        }
Example #2
0
        public void UpdateContactsAndFault(ContactsAndFault theContactsAndFault)
        {
            try { m_ContactsAndFaultsDictionary.Remove(theContactsAndFault.ContactsAndFaults_ID); }
            catch { }

            theContactsAndFault.RequiresUpdate = true;
            m_ContactsAndFaultsDictionary.Add(theContactsAndFault.ContactsAndFaults_ID, theContactsAndFault);
        }
Example #3
0
        public void AddContactsAndFaults(string SqlWhereClause)
        {
            int idFld      = m_ContactsAndFaultsFC.FindField("ContactsAndFaults_ID");
            int typeFld    = m_ContactsAndFaultsFC.FindField("Type");
            int concFld    = m_ContactsAndFaultsFC.FindField("IsConcealed");
            int locConfFld = m_ContactsAndFaultsFC.FindField("LocationConfidenceMeters");
            int exConfFld  = m_ContactsAndFaultsFC.FindField("ExistenceConfidence");
            int idConfFld  = m_ContactsAndFaultsFC.FindField("IdentityConfidence");
            int symbFld    = m_ContactsAndFaultsFC.FindField("Symbol");
            int lblFld     = m_ContactsAndFaultsFC.FindField("Label");
            int notesFld   = m_ContactsAndFaultsFC.FindField("Notes");
            int dsFld      = m_ContactsAndFaultsFC.FindField("DataSourceID");
            int symFld     = m_ContactsAndFaultsFC.FindField("RuleID");

            IQueryFilter QF = new QueryFilterClass();

            QF.WhereClause = SqlWhereClause;

            IFeatureCursor theCursor  = m_ContactsAndFaultsFC.Search(QF, false);
            IFeature       theFeature = theCursor.NextFeature();

            while (theFeature != null)
            {
                ContactsAndFault anContactsAndFault = new ContactsAndFault();
                anContactsAndFault.ContactsAndFaults_ID = theFeature.get_Value(idFld).ToString();
                anContactsAndFault.Type = theFeature.get_Value(typeFld).ToString();
                bool   result        = int.TryParse(theFeature.get_Value(concFld).ToString(), out anContactsAndFault.IsConcealed);
                string locConfFldStr = theFeature.get_Value(locConfFld).ToString();
                anContactsAndFault.LocationConfidenceMeters = double.Parse(string.IsNullOrEmpty(locConfFldStr) ? "-9999" : locConfFldStr);
                anContactsAndFault.ExistenceConfidence      = theFeature.get_Value(exConfFld).ToString();
                anContactsAndFault.IdentityConfidence       = theFeature.get_Value(idConfFld).ToString();
                anContactsAndFault.Symbol         = theFeature.get_Value(symbFld).ToString();
                anContactsAndFault.Label          = theFeature.get_Value(lblFld).ToString();
                anContactsAndFault.Notes          = theFeature.get_Value(notesFld).ToString();
                anContactsAndFault.DataSourceID   = theFeature.get_Value(dsFld).ToString();
                anContactsAndFault.RuleID         = theFeature.get_Value(symFld).ToString();
                anContactsAndFault.Shape          = (IPolyline)theFeature.Shape;
                anContactsAndFault.RequiresUpdate = true;

                m_ContactsAndFaultsDictionary.Add(anContactsAndFault.ContactsAndFaults_ID, anContactsAndFault);

                theFeature = theCursor.NextFeature();
            }
        }
        public void AddContactsAndFaults(string SqlWhereClause)
        {
            int idFld = m_ContactsAndFaultsFC.FindField("ContactsAndFaults_ID");
            int typeFld = m_ContactsAndFaultsFC.FindField("Type");
            int concFld = m_ContactsAndFaultsFC.FindField("IsConcealed");
            int locConfFld = m_ContactsAndFaultsFC.FindField("LocationConfidenceMeters");
            int exConfFld = m_ContactsAndFaultsFC.FindField("ExistenceConfidence");
            int idConfFld = m_ContactsAndFaultsFC.FindField("IdentityConfidence");
            int symbFld = m_ContactsAndFaultsFC.FindField("Symbol");
            int lblFld = m_ContactsAndFaultsFC.FindField("Label");
            int notesFld = m_ContactsAndFaultsFC.FindField("Notes");
            int dsFld = m_ContactsAndFaultsFC.FindField("DataSourceID");
            int symFld = m_ContactsAndFaultsFC.FindField("RuleID");

            IQueryFilter QF = new QueryFilterClass();
            QF.WhereClause = SqlWhereClause;

            IFeatureCursor theCursor = m_ContactsAndFaultsFC.Search(QF, false);
            IFeature theFeature = theCursor.NextFeature();

            while (theFeature != null)
            {
                ContactsAndFault anContactsAndFault = new ContactsAndFault();
                anContactsAndFault.ContactsAndFaults_ID = theFeature.get_Value(idFld).ToString();
                anContactsAndFault.Type = theFeature.get_Value(typeFld).ToString();
                bool result = int.TryParse(theFeature.get_Value(concFld).ToString(), out anContactsAndFault.IsConcealed);
                string locConfFldStr = theFeature.get_Value(locConfFld).ToString();
                anContactsAndFault.LocationConfidenceMeters = double.Parse(string.IsNullOrEmpty(locConfFldStr) ? "-9999" : locConfFldStr);
                anContactsAndFault.ExistenceConfidence = theFeature.get_Value(exConfFld).ToString();
                anContactsAndFault.IdentityConfidence = theFeature.get_Value(idConfFld).ToString();
                anContactsAndFault.Symbol = theFeature.get_Value(symbFld).ToString();
                anContactsAndFault.Label = theFeature.get_Value(lblFld).ToString();
                anContactsAndFault.Notes = theFeature.get_Value(notesFld).ToString();
                anContactsAndFault.DataSourceID = theFeature.get_Value(dsFld).ToString();
                anContactsAndFault.RuleID = theFeature.get_Value(symFld).ToString();
                anContactsAndFault.Shape = (IPolyline)theFeature.Shape;
                anContactsAndFault.RequiresUpdate = true;

                m_ContactsAndFaultsDictionary.Add(anContactsAndFault.ContactsAndFaults_ID, anContactsAndFault);

                theFeature = theCursor.NextFeature();
            }
        }
Example #5
0
        public string NewContactsAndFault(string Type, int IsConcealed, double LocationConfidenceMeters, string ExistenceConfidence, string IdentityConfidence,
                                          string Symbol, string Label, string Notes, string DataSourceID, string RuleID, IPolyline Shape)
        {
            ContactsAndFault newContactsAndFault = new ContactsAndFault();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newContactsAndFault.ContactsAndFaults_ID = SysInfoTable.ProjAbbr + ".ContactsAndFaults." + SysInfoTable.GetNextIdValue("ContactsAndFaults");
            newContactsAndFault.Type        = Type;
            newContactsAndFault.IsConcealed = IsConcealed;
            newContactsAndFault.LocationConfidenceMeters = LocationConfidenceMeters;
            newContactsAndFault.ExistenceConfidence      = ExistenceConfidence;
            newContactsAndFault.IdentityConfidence       = IdentityConfidence;
            newContactsAndFault.Symbol         = Symbol;
            newContactsAndFault.Label          = Label;
            newContactsAndFault.Notes          = Notes;
            newContactsAndFault.DataSourceID   = DataSourceID;
            newContactsAndFault.RuleID         = RuleID;
            newContactsAndFault.Shape          = Shape;
            newContactsAndFault.RequiresUpdate = false;

            m_ContactsAndFaultsDictionary.Add(newContactsAndFault.ContactsAndFaults_ID, newContactsAndFault);
            return(newContactsAndFault.ContactsAndFaults_ID);
        }
        public void DeleteContactsAndFaults(ContactsAndFault theContactsAndFault)
        {
            try { m_ContactsAndFaultsDictionary.Remove(theContactsAndFault.ContactsAndFaults_ID); }
            catch { }

            IEditor theEditor = ArcMap.Editor;
            if (theEditor.EditState == esriEditState.esriStateNotEditing) { theEditor.StartEditing(m_theWorkspace); }
            theEditor.StartOperation();

            try
            {
                IQueryFilter QF = new QueryFilterClass();
                QF.WhereClause = "ContactsAndFaults_ID = '" + theContactsAndFault.ContactsAndFaults_ID + "'";

                ITable ContactsAndFaultsTable = m_ContactsAndFaultsFC as ITable;
                ContactsAndFaultsTable.DeleteSearchedRows(QF);

                theEditor.StopOperation("Delete ContactsAndFaults");
            }
            catch (Exception e) { theEditor.StopOperation("ContactsAndFaults Management Failure"); }
        }
        public void UpdateContactsAndFault(ContactsAndFault theContactsAndFault)
        {
            try { m_ContactsAndFaultsDictionary.Remove(theContactsAndFault.ContactsAndFaults_ID); }
            catch { }

            theContactsAndFault.RequiresUpdate = true;
            m_ContactsAndFaultsDictionary.Add(theContactsAndFault.ContactsAndFaults_ID, theContactsAndFault);
        }
        public string NewContactsAndFault(string Type, int IsConcealed, double LocationConfidenceMeters, string ExistenceConfidence, string IdentityConfidence,
            string Label, string Notes, string DataSourceID, string Symbol, IPolyline Shape)
        {
            ContactsAndFault newContactsAndFault = new ContactsAndFault();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newContactsAndFault.ContactsAndFaults_ID = SysInfoTable.ProjAbbr + ".ContactsAndFaults." + SysInfoTable.GetNextIdValue("ContactsAndFaults");
            newContactsAndFault.Type = Type;
            newContactsAndFault.IsConcealed = IsConcealed;
            newContactsAndFault.LocationConfidenceMeters = LocationConfidenceMeters;
            newContactsAndFault.ExistenceConfidence = ExistenceConfidence;
            newContactsAndFault.IdentityConfidence = IdentityConfidence;
            newContactsAndFault.Label = Label;
            newContactsAndFault.Notes = Notes;
            newContactsAndFault.DataSourceID = DataSourceID;
            newContactsAndFault.Symbol = Symbol;
            newContactsAndFault.Shape = Shape;
            newContactsAndFault.RequiresUpdate = false;

            m_ContactsAndFaultsDictionary.Add(newContactsAndFault.ContactsAndFaults_ID, newContactsAndFault);
            return newContactsAndFault.ContactsAndFaults_ID;
        }
Example #9
0
        public void SaveContactsAndFaults()
        {
            int idFld      = m_ContactsAndFaultsFC.FindField("ContactsAndFaults_ID");
            int typeFld    = m_ContactsAndFaultsFC.FindField("Type");
            int concFld    = m_ContactsAndFaultsFC.FindField("IsConcealed");
            int locConfFld = m_ContactsAndFaultsFC.FindField("LocationConfidenceMeters");
            int exConfFld  = m_ContactsAndFaultsFC.FindField("ExistenceConfidence");
            int idConfFld  = m_ContactsAndFaultsFC.FindField("IdentityConfidence");
            int symbFld    = m_ContactsAndFaultsFC.FindField("Symbol");
            int lblFld     = m_ContactsAndFaultsFC.FindField("Label");
            int notesFld   = m_ContactsAndFaultsFC.FindField("Notes");
            int dsFld      = m_ContactsAndFaultsFC.FindField("DataSourceID");
            int symFld     = m_ContactsAndFaultsFC.FindField("RuleID");

            IEditor theEditor = ArcMap.Editor;

            if (theEditor.EditState == esriEditState.esriStateNotEditing)
            {
                theEditor.StartEditing(m_theWorkspace);
            }
            theEditor.StartOperation();

            try
            {
                string         updateWhereClause = "ContactsAndFaults_ID = '";
                IFeatureCursor insertCursor      = m_ContactsAndFaultsFC.Insert(true);

                foreach (KeyValuePair <string, ContactsAndFault> aDictionaryEntry in m_ContactsAndFaultsDictionary)
                {
                    ContactsAndFault thisContactsAndFault = (ContactsAndFault)aDictionaryEntry.Value;
                    switch (thisContactsAndFault.RequiresUpdate)
                    {
                    case true:
                        updateWhereClause += thisContactsAndFault.ContactsAndFaults_ID + "' OR ContactsAndFaults_ID = '";
                        break;

                    case false:
                        IFeatureBuffer theFeatureBuffer = m_ContactsAndFaultsFC.CreateFeatureBuffer();
                        theFeatureBuffer.set_Value(idFld, thisContactsAndFault.ContactsAndFaults_ID);
                        theFeatureBuffer.set_Value(typeFld, thisContactsAndFault.Type);
                        theFeatureBuffer.set_Value(concFld, thisContactsAndFault.IsConcealed);
                        theFeatureBuffer.set_Value(locConfFld, thisContactsAndFault.LocationConfidenceMeters);
                        theFeatureBuffer.set_Value(exConfFld, thisContactsAndFault.ExistenceConfidence);
                        theFeatureBuffer.set_Value(idConfFld, thisContactsAndFault.IdentityConfidence);
                        theFeatureBuffer.set_Value(symbFld, thisContactsAndFault.Symbol);
                        theFeatureBuffer.set_Value(lblFld, thisContactsAndFault.Label);
                        theFeatureBuffer.set_Value(notesFld, thisContactsAndFault.Notes);
                        theFeatureBuffer.set_Value(dsFld, thisContactsAndFault.DataSourceID);
                        theFeatureBuffer.set_Value(symFld, thisContactsAndFault.RuleID);
                        theFeatureBuffer.Shape = thisContactsAndFault.Shape;

                        insertCursor.InsertFeature(theFeatureBuffer);
                        break;
                    }
                }

                System.Runtime.InteropServices.Marshal.ReleaseComObject(insertCursor);
                theEditor.StopOperation("Insert ContactsAndFaults");

                if (updateWhereClause == "ContactsAndFaults_ID = '")
                {
                    return;
                }

                theEditor.StartOperation();
                updateWhereClause = updateWhereClause.Remove(updateWhereClause.Length - 28);

                IQueryFilter QF = new QueryFilterClass();
                QF.WhereClause = updateWhereClause;

                IFeatureCursor updateCursor = m_ContactsAndFaultsFC.Update(QF, false);
                IFeature       theFeature   = updateCursor.NextFeature();

                while (theFeature != null)
                {
                    string theID = theFeature.get_Value(idFld).ToString();

                    ContactsAndFault thisContactsAndFault = m_ContactsAndFaultsDictionary[theID];
                    theFeature.set_Value(typeFld, thisContactsAndFault.Type);
                    theFeature.set_Value(concFld, thisContactsAndFault.IsConcealed);
                    theFeature.set_Value(locConfFld, thisContactsAndFault.LocationConfidenceMeters);
                    theFeature.set_Value(exConfFld, thisContactsAndFault.ExistenceConfidence);
                    theFeature.set_Value(idConfFld, thisContactsAndFault.IdentityConfidence);
                    theFeature.set_Value(lblFld, thisContactsAndFault.Label);
                    theFeature.set_Value(notesFld, thisContactsAndFault.Notes);
                    theFeature.set_Value(dsFld, thisContactsAndFault.DataSourceID);
                    theFeature.set_Value(symFld, thisContactsAndFault.RuleID);
                    theFeature.Shape = thisContactsAndFault.Shape;
                    updateCursor.UpdateFeature(theFeature);

                    theFeature = updateCursor.NextFeature();
                }

                theEditor.StopOperation("Update ContactsAndFaults");
            }
            catch { theEditor.StopOperation("ContactsAndFaults Management Failure"); }
        }