Example #1
0
        public DocumentUploader()
        {
            InitializeComponent();

            CmsWebService service = new CmsWebService();

            WindowsIdentity windowsUser = WindowsIdentity.GetCurrent();
            if (windowsUser == null)
            {
                return;
            }

            List<string> temp = windowsUser.Name.Split('\\').ToList();
            User user = service.GetUser(temp.Last());

            ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings["CmsEntities"];
            EntityConnectionStringBuilder builder = new EntityConnectionStringBuilder(settings.ConnectionString);
            SqlConnectionStringBuilder conn = new SqlConnectionStringBuilder(builder.ProviderConnectionString);

            lblTitle.Text = string.Format("Document Version Imports: by {0} into {1} on {2}", user.UserName, conn.InitialCatalog, conn.DataSource);

            mMetaData.UserId = user.Id;
            using (mWorker = new BackgroundWorker())
            {
                mWorker.WorkerSupportsCancellation = true;
                mWorker.WorkerReportsProgress = true;
                mWorker.ProgressChanged += bw_ProgressChanged;
                mWorker.RunWorkerCompleted += bw_RunWorkerCompleted;

                mWorker.DoWork += (s1, e1) =>
                    {
                        try
                        {
                            if (mWorker.CancellationPending)
                            {
                                mWorker.CancelAsync();
                                mWorker.Dispose();
                            }
                            else
                            {
                                //WORK
                                ImportDocuments(mWorker);
                            }
                        }
                        catch (ThreadAbortException)
                        {
                            Thread.ResetAbort();
                        }
                    };
            }
        }
Example #2
0
        public IssuesPanel(CmsWebService.Issue issueCopy)
        {
            //used in the Copy process.

            InitializeComponent();
            CompositionInitializer.SatisfyImports(this);

            TabChanges = new List<string> { "Name" };
            InitialiseButtonVisibility();

            mIssuePanelViewModel = new IssuePanelViewModel(issueCopy, this);
            IssueLoaded(); //just call this as we have no db calls.
            RequiresSave = true;
        }
Example #3
0
        public AddIssueDialog(CmsWebService.Issue copy, int copiedId)
        {
            // Required to initialize variables
            InitializeComponent();

            ultimateSpellSL1.IncludeDirectory = CommonUtils.UltimateSpellIncludeUrl;

            Title = string.Format("Copy of Issue {0}", copiedId);

            PromptButton.Visibility = CMS.AppSetting.IssuePromptEnabled ? Visibility.Visible : Visibility.Collapsed;

            mModel = new AddIssueViewModel(copy, true) {View = this};
            mModel.ModelLoaded += e =>
            {
                DataContext = mModel;
                GotFocus += AddIssueDialog_GotFocus;
            };
        }
Example #4
0
        internal static string GetFinalRiskRatingText(int issueId)
        {
            var cmsWebService = new CmsWebService();
            IList<IssueRisk> highestRiskRatings = cmsWebService.GetIssueHighestRiskRatings(issueId);

            IssueRiskMatrix highestFinalRiskMatrix = null;
            foreach (IssueRisk highestRisk in highestRiskRatings)
            {
                if (highestRisk.RiskTypeId == 2) //Final
                {
                    highestFinalRiskMatrix = highestRisk.IssueRiskMatrix;
                }
            }

            if (highestFinalRiskMatrix != null)
            {
                return string.Format("{0} - {1}", highestFinalRiskMatrix.RiskRatingNumber, highestFinalRiskMatrix.IssueRiskRating.Name);
            }

            return string.Empty;
        }