private int GetContact1StartVersionNumber() { int contact1StartVersionNumber = 1; try { using (GoldmineEntities context = new GoldmineEntities()) { contact1StartVersionNumber = int.Parse((from c in context.CONTACT1ChangeTracking(1) select c.SYS_CHANGE_VERSION).ToList().OrderByDescending(c => c.Value).First().Value.ToString()); } } catch (Exception) { return(contact1StartVersionNumber); } return(contact1StartVersionNumber); }
public List <CONTACT1ChangeTracking_Result> GetContact1ChangeTrackingResults(int _contact1StartVersionNumber) { List <CONTACT1ChangeTracking_Result> results = new List <CONTACT1ChangeTracking_Result>(); try { using (GoldmineEntities context = new GoldmineEntities()) { results = (from c in context.CONTACT1ChangeTracking(_contact1StartVersionNumber) select c).ToList(); } if (results.Count > 0) { _versionNumberProcess.UpdateContact1VersionNumber(int.Parse(results.OrderByDescending(x => x.SYS_CHANGE_VERSION).FirstOrDefault().SYS_CHANGE_VERSION.Value.ToString())); } } catch (Exception ex) { _exceptionLogging.LogException(ex); } return(results); }