public void GoToIssueLinkLinkHandler(object parameter)
        {
            QuickActiveOverride payload = parameter as QuickActiveOverride;
            if (payload == null) throw new ArgumentNullException("parameter");

            QuickIssue quickIssue = new QuickIssue{Id = payload.IssueId, IsActive = true};
            EventAggregator.GetEvent<PrismEvents.OpenTabPrismEvent>().Publish(quickIssue);
        }
예제 #2
0
        public IssueSummaryListView(List<int> ints, CommonUtils.SummaryViewType summaryType, string filterName)
        {
            InitializeComponent();
            CompositionInitializer.SatisfyImports(this);

            RadContextMenu radContextMenu = removeFavouriteContextMenu.Parent as RadContextMenu;

            if (summaryType == CommonUtils.SummaryViewType.MyFavouriteIssues)
            {
                if (radContextMenu == null)
                {
                    return;
                }

                radContextMenu.Opened += (s, e) =>
                    {
                        RadContextMenu menu = (RadContextMenu) s;
                        menu.Items.Clear();
                        GridViewRow row = menu.GetClickedElement<GridViewRow>();

                        if (row != null)
                        {
                            row.IsSelected = row.IsCurrent = true;
                            GridViewCell cell = menu.GetClickedElement<GridViewCell>();
                            if (cell != null)
                            {
                                cell.IsCurrent = true;
                                var issueSummaryDto = row.DataContext as IssueSummaryDto;
                                if (issueSummaryDto != null)
                                {
                                    var quickIssue = new QuickIssue {Id = issueSummaryDto.Id, IsActive = issueSummaryDto.IsActive};

                                    RadMenuItem rmi = new RadMenuItem {Header = "Remove from Favourites", Icon = null};
                                    rmi.IsEnabled = (CMS.EffectivePrivileges.AdminTab.CanDelete || CMS.EffectivePrivileges.IssueTab.CanView) && quickIssue.IsActive;
                                    rmi.Click += (s3, args) => RemoveFromFavourites(quickIssue);
                                    menu.Items.Add(rmi);
                                }
                            }
                        }
                        else
                        {
                            menu.IsOpen = false;
                        }
                    };
            }
            else
            {
                radContextMenu.Visibility = Visibility.Collapsed;
            }

            mViewModel = new IssueSummaryListViewModel(ints, summaryType, filterName);
            FilterName = filterName;
            SummaryType = summaryType;
            DataContext = mViewModel;
        }
예제 #3
0
        private void RemoveIssue(QuickIssue quickIssue)
        {
            if (!CMS.EffectivePrivileges.IssueTab.CanDelete || !CMS.EffectivePrivileges.AdminTab.CanModify || !quickIssue.IsActive)
            {
                return;
            }

            string message = String.Format("Delete Issue {0} - '{1}'  Issue?", quickIssue.Id, quickIssue.Name);
            var popupDialog = new PopupDialog(PopupDialogType.ConfirmDelete, message);

            popupDialog.Show();
            popupDialog.Closed +=
                (s2, e2) =>
                {
                    if (popupDialog.PopupDialogResult == PopupDialogResult.Yes)
                    {
                        //DELETE
                        var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);

                        cmsWebServiceClient.DeleteIssueCompleted +=
                            (s1, e1) =>
                            {
                                EventAggregator.GetEvent<PrismEvents.CloseTabPrismEvent>().Publish(quickIssue);
                            };

                        cmsWebServiceClient.DeleteIssueAsync(quickIssue.Id, CMS.User.Id);
                    }
                };
        }
예제 #4
0
        private void OpenTab(QuickIssue issue)
        {
            //Check whether we already have this issue open
            bool issueAlreadyOpen = false;
            foreach (RadTabItem tabItem in MainTabControl.Items)
            {
                var issuePanel = tabItem.Content as IssuesPanel;

                if (issuePanel != null)
                {
                    if (issuePanel.IssueId == issue.Id)
                    {
                        //Issue is already open so select it
                        tabItem.IsSelected = true;
                        issueAlreadyOpen = true;
                        break;
                    }
                }
            }

            if (issueAlreadyOpen == false)
            {
                var ti = new RadTabItem();

                MainTabControl.Items.Add(ti);
                var th = new TabHeader(ti, this);
                th.headerLabel.Content = String.Format("Issue #{0}", issue.Id);
                ti.Header = th;
                ti.IsSelected = true;
                ti.DropDownContent = th.headerLabel.Content.ToString();
                ti.Content = new IssuesPanel(issue.Id);

                if (CMS.EffectivePrivileges.IssueTab.CanModify || CMS.EffectivePrivileges.AdminTab.CanModify)
                {
                    BuildTabLockEventHandler(th.headerLabel.Content.ToString());
                }
            }
        }
예제 #5
0
        private void OpenIssueTab(QuickIssue issue)
        {
            if (issue == null || !issue.IsActive)
            {
                return;
            }

            if (issue.RestrictedContent)
            {
                //Only allowed users can open restricted Issue
                var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
                cmsWebServiceClient.CanUserOpenRestrictedIssueCompleted += (s, e) =>
                {
                    if (e.Result)
                    {
                        OpenTab(issue);
                    }
                    else
                    {
                        var dialog = new PopupDialog(PopupDialogType.Error,
                            "Access is restricted due to issue content – please contact the System Administrator.",
                            "Restricted Content Issue");
                        dialog.Show();
                    }
                };
                cmsWebServiceClient.CanUserOpenRestrictedIssueAsync(issue.Id, CMS.User.Id);
            }
            else
            {
                OpenTab(issue);
            }
        }
        private void UnMarkIssueAsRestrictedContent(QuickIssue quickIssue)
        {
            var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);

            cmsWebServiceClient.UnMarkIssueAsRestrictedCompleted += (s, e) =>
            {
                if (e.Result)
                {
                    quickIssue.RestrictedContent = false;

                }
                else
                {
                    var dialog = new PopupDialog(PopupDialogType.Error,
                        "Access is restricted due to issue content – please contact the System Administrator.",
                        "Restricted Content Issue");
                    dialog.Show();
                }
            };
            cmsWebServiceClient.UnMarkIssueAsRestrictedAsync(quickIssue.Id, CMS.User.Id);
        }
 private void ReinstateIssue(QuickIssue quickIssue)
 {
     var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
     cmsWebServiceClient.SaveIsActiveEquipmentStateCompleted += (s, e) => { mViewModel.ProcessSearchFilter(); };
     cmsWebServiceClient.SaveIsActiveEquipmentStateAsync(CommonUtils.ModelType.Issue, quickIssue.Id, true, CMS.User.Id);
 }
 private void OpenNewIssueTab(QuickIssue issue)
 {
     EventAggregator.GetEvent<PrismEvents.OpenTabPrismEvent>().Publish(issue);
 }
        private void MarkIssueAsRestrictedContent(QuickIssue quickIssue)
        {
            var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);

            cmsWebServiceClient.MarkIssueAsRestrictedCompleted += (s, e) =>
            {
                if (e.Result)
                {
                    quickIssue.RestrictedContent = true;

                }
                else
                {
                    var dialog = new PopupDialog(PopupDialogType.Error,
                        "Only administrator or users in the distribution list can mark this issue as restricted.",
                        "Restricted Content Issue");
                    dialog.Show();
                }
            };

            cmsWebServiceClient.MarkIssueAsRestrictedAsync(quickIssue.Id, CMS.User.Id);
        }
 private void AddToFavourites(QuickIssue quickIssue)
 {
     EventAggregator.GetEvent<PrismEvents.AddFavouritePrismEvent>().Publish(quickIssue);
 }
예제 #11
0
 private void RemoveFromFavourites(QuickIssue quickIssue)
 {
     EventAggregator.GetEvent<PrismEvents.RemoveFavouritePrismEvent>().Publish(quickIssue);
     mViewModel.RemoveIssue(quickIssue.Id);
 }
예제 #12
0
        public void GoToIssueLinkLinkHandler(object parameter)
        {
            QuickIssue quickIssue = parameter as QuickIssue;
            if (quickIssue == null)
            {
                var dto = parameter as IssueSummaryDto;

                if (dto == null)  throw new ArgumentNullException("parameter");

                quickIssue = new QuickIssue { Id = dto.Id, Name = dto.Name, IsActive = dto.IsActive};
            }
            EventAggregator.GetEvent<PrismEvents.OpenTabPrismEvent>().Publish(quickIssue);
        }
예제 #13
0
        public void GoToIssueLinkLinkHandler(object parameter)
        {
            QuickIssue payLoad = new QuickIssue();

            if (parameter is MyIntrayIssueDto)
            {
                var myIntrayIssueDto = parameter as MyIntrayIssueDto;
                payLoad.Id = myIntrayIssueDto.Id;
                payLoad.IsActive = myIntrayIssueDto.IsActive;
            }

            if (parameter is QuickAction)
            {
                payLoad = new QuickIssue();
                var quickAction = parameter as QuickAction;
                payLoad.Id = quickAction.IssueId;
                payLoad.IsActive = true;
            }

            if (payLoad.Id > 0)
            {
                EventAggregator.GetEvent<PrismEvents.OpenTabPrismEvent>().Publish(payLoad);
            }
            else
            {
                throw new ArgumentNullException("parameter");
            }
        }