コード例 #1
0
ファイル: NotamCodesService.cs プロジェクト: ali60/NOTAM
 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;
 }
コード例 #2
0
ファイル: NotamCodeViewModel.cs プロジェクト: ali60/NOTAM
        public NotamCodeViewModel(NotamCode notamcode, NotamCodeService notamcodeService)
        {
            if (notamcode == null)
                throw new ArgumentNullException("notamcode");

            if (notamcodeService == null)
                throw new ArgumentNullException("notamcodeService");

            _notamcode = notamcode;
            _notamcodeService = notamcodeService;
           
        }
コード例 #3
0
ファイル: NotamCodesService.cs プロジェクト: ali60/NOTAM
        /// <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));
            }
        }
コード例 #4
0
ファイル: NotamCodeViewModel.cs プロジェクト: ali60/NOTAM
 public NotamCodeViewModel(NotamCode notamcode, NotamCodeService notamcodeService, ObservableCollection<WorkspaceViewModel> parent)
     : this(notamcode, notamcodeService)
 {
     parentWorkSpaces = parent;
 }
コード例 #5
0
ファイル: NotamCodesService.cs プロジェクト: ali60/NOTAM
        /// <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);
        }
コード例 #6
0
ファイル: NotamCodesService.cs プロジェクト: ali60/NOTAM
        /// <summary>
        /// 
        /// </summary>
        /// <param name="origin"></param>
        public void Delete(NotamCode NCode)
        {

        }
コード例 #7
0
ファイル: NotamCodesService.cs プロジェクト: ali60/NOTAM
 /// <summary>
 /// 
 /// </summary>
 /// <param name="origin"></param>
 public void Update(NotamCode NCode)
 {
    _dataContext.SubmitChanges();
 }