public bool IsNew(NotamCode NCode) { if(NCode == null || string.IsNullOrEmpty(NCode.Subject) || string.IsNullOrEmpty(NCode.Condition)) return false; var item = _NotamCode.Where(n => n.Subject.Equals(NCode.Subject) && n.Condition.Equals(NCode.Condition)).ToList(); if (item.Count==0) return true; return false; }
public NotamCodeViewModel(NotamCode notamcode, NotamCodeService notamcodeService) { if (notamcode == null) throw new ArgumentNullException("notamcode"); if (notamcodeService == null) throw new ArgumentNullException("notamcodeService"); _notamcode = notamcode; _notamcodeService = notamcodeService; }
/// <summary> /// Places the specified origin into the repository. /// If the origin is already in the repository, an /// exception is not thrown. /// </summary> public void Insert(NotamCode NCode) { if (NCode == null) throw new ArgumentNullException("NotamCode"); if (!_NotamCode.Contains(NCode)) { _NotamCode.Add(NCode); _dataContext.NotamCodes.InsertOnSubmit(NCode); _dataContext.SubmitChanges(); if (this.NotamCodesAdded != null) this.NotamCodesAdded(this, new EntityAddedEventArgs<NotamCode>(NCode)); } }
public NotamCodeViewModel(NotamCode notamcode, NotamCodeService notamcodeService, ObservableCollection<WorkspaceViewModel> parent) : this(notamcode, notamcodeService) { parentWorkSpaces = parent; }
/// <summary> /// Returns true if the specified origin exists in the /// repository, or false if it is not. /// </summary> public bool ContainsNotamCode(NotamCode NCode) { if (NCode == null) throw new ArgumentNullException("NotamCode"); return _NotamCode.Contains(NCode); }
/// <summary> /// /// </summary> /// <param name="origin"></param> public void Delete(NotamCode NCode) { }
/// <summary> /// /// </summary> /// <param name="origin"></param> public void Update(NotamCode NCode) { _dataContext.SubmitChanges(); }