public void Save() { bool needSave = false; if (SortMainId > 0) { var o = SortMainObject.GetSortMain(SortMainId).OpenNetData; if (o == null) { o = new OpenNetObject(SortMainId); } if (o.SortMainId != SortMainId) { o.SortMainId = SortMainId; } if (AccessNumber?.Trim() != o.AccessNumber) { o.AccessNumber = AccessNumber?.Trim(); needSave = true; } if (DocLocation?.Trim() != o.DocLocation) { o.DocLocation = DocLocation?.Trim(); needSave = true; } if (FieldOfficeAym?.Trim() != o.FieldOfficeAym) { o.FieldOfficeAym = FieldOfficeAym?.Trim(); needSave = true; } if (DeclassificationStatus != o.DeclassificationStatus) { o.DeclassificationStatus = DeclassificationStatus; needSave = true; } if (DeclassificationDate != o.DeclassificationDate) { o.DeclassificationDate = DeclassificationDate; needSave = true; } if (Keywords?.Trim() != o.Keywords) { o.Keywords = Keywords?.Trim(); needSave = true; } if (needSave) { o.Save(); } } }
void getInfoDigits() { InfoDigits = 0; if (AccessNumber.Length == 12) { var _infoDigitsStr = AccessNumber.Substring(10, 2); InfoDigits = byte.Parse(_infoDigitsStr); } }
public Session(ISessionChannel pSessionChannel) { //State = SessionState.Leg1; Channel = pSessionChannel; CallId = pSessionChannel.CallId; OrigIPAddress = pSessionChannel.OrigIPAddress; parseAccessNumber(pSessionChannel.AccessNumber); getInfoDigits(); if (InfoDigits > 0) { AccessNumber = AccessNumber.Substring(0, 10); } ANI = pSessionChannel.ANI; Id = Guid.NewGuid().ToString("N"); }