예제 #1
0
        /// <summary>
        /// Saves the customer to the repository.  This method is invoked by the SaveCommand.
        /// </summary>
        
        public void Search()
        {
            if (!ValidateType())
                return;
            var notamFilter = new NotamFilter();
            if(Type!=null )
             notamFilter.TypeFilter = (Type.Equals("A") ||Type.Equals("B"))? Type: string.Empty ;
            notamFilter.NumberFilter = NotamNum ;
            notamFilter.YearFilter = NotamYear;
            notamFilter.NotamCodeFilter =(IsQCode && QCode != null) ? QCode.ToString() : string.Empty;
                                         
            notamFilter.NotamAeroFilter =(IsAD && Aerodom!=null)?Aerodom.Code: string.Empty    ;
            notamFilter.notamStatus = IsValid ? "D" : "A";
            notamFilter.notamStatus = IsHold ? "H" : notamFilter.notamStatus;
            notamFilter.notamStatus = IsAllNotams ? "AD" : notamFilter.notamStatus;
            notamFilter.ItemEFilter = EFreeText;
            notamFilter.NotamFirFilter = FIR!=null?FIR.Code:string.Empty ;
            notamFilter.ScopeFilter = IsQualifier? Scope: string.Empty  ;
            notamFilter.PurposeFilter =IsQualifier ? Purpose: string.Empty ;
            notamFilter.TrafficFilter =IsQualifier ? Traffic: string.Empty  ;
            notamFilter.PermEstFilter = IsPerm ? "PERM" : IsEst ? "EST" : string.Empty;
            notamFilter.FromDateFilter = FromDate;
            notamFilter.ToDateFilter = ToDate;
            notamFilter.UserFilter = UserText;
            notamFilter.SendTimeFilter = FromIssueDate;
            notamFilter.SendTimeEndFilter = ToIssueDate;
            _notamService.Archive();
            _notamService.Reload();

            AllNotamsViewModel workspace =
                parentWorkSpaces.FirstOrDefault(vm => vm is AllNotamsViewModel)
                as AllNotamsViewModel;
            //if (workspace == null)
            //{
                workspace = new AllNotamsViewModel(_notamService, parentWorkSpaces, notamFilter );
                string strTitle = Entity.AllNotamsViewModel_DisplayName;
                if (notamFilter.notamStatus == "A")
                    strTitle = Entity.MainWindowViewModel_Command_ViewAllArchiveNotams;
                if (notamFilter.notamStatus == "H")
                    strTitle = Entity.MainWindowViewModel_Command_ViewAllHoldNotams;
                if (notamFilter.notamStatus == "AD")
                    strTitle = Entity.AllArchAndValidNotamsViewModel_DisplayName;
                foreach (var obj in this.parentWorkSpaces)
                {
                    if (obj.DisplayName == strTitle)
                    {
                        parentWorkSpaces.Remove(obj);
                        break;
                    }

                }
                this.parentWorkSpaces.Add(workspace);
           // }
            this.SetActiveWorkspace(workspace);
            
        }
예제 #2
0
        void ShowAllNotams(string notamStatus)
        {
            string strTitle = Entity.AllNotamsViewModel_DisplayName;
            if (notamStatus == "A")
                strTitle = Entity.MainWindowViewModel_Command_ViewAllArchiveNotams;
            if (notamStatus == "H")
                strTitle = Entity.MainWindowViewModel_Command_ViewAllHoldNotams;
            foreach (var obj in this.Workspaces)
            {
                if (obj.DisplayName == strTitle)
                {
                    Workspaces.Remove(obj);
                    break;
                }

            }
            _notamService.Reload();
            _notamService.Archive();
            AllNotamsViewModel workspace =
                this.Workspaces.FirstOrDefault(vm => vm is AllNotamsViewModel)
                as AllNotamsViewModel;
            //if (workspace == null)
            //{
                workspace = new AllNotamsViewModel(_notamService, Workspaces,notamStatus);
                this.Workspaces.Add(workspace);
           // }
            this.SetActiveWorkspace(workspace);
        }