private void doNextConfigurationStep()
        {
            WBTaskFeedback feedback = collection.DoConfigurationStep(NextConfigurationStep.Value);

            ConfigurationSteps.WBxUpdateTask(feedback);

            if (!String.IsNullOrEmpty(feedback.NextTaskName))
            {
                NextConfigurationStep.Value = feedback.NextTaskName;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "TriggerNextStepFunction", "WorkBoxFramework_triggerNextConfigurationStep();", true);
            }
            else
            {
                CancelButton.Text = "Done";
            }
        }
Esempio n. 2
0
        protected void KeepNextDocument(object sender, EventArgs e)
        {
            WBLogging.Debug("Attempting to keep the next document with index: " + indexOfNextRecordToKeep + " and filename: " + mappedFilenames[indexOfNextRecordToKeep.ToString()]);

            String         callingUserLogin = SPContext.Current.Web.CurrentUser.LoginName;
            WBTaskFeedback feedback         = new WBTaskFeedback(indexOfNextRecordToKeep.ToString());

            try
            {
                SPSecurity.RunWithElevatedPrivileges(delegate()
                {
                    using (WBRecordsManager elevatedManager = new WBRecordsManager(callingUserLogin))
                    {
                        WBRecord record             = elevatedManager.Libraries.GetRecordByID(recordIDs[indexOfNextRecordToKeep]);
                        record[WBColumn.ReviewDate] = DateTime.Now.AddYears(2);
                        record.Update(callingUserLogin, ReasonToKeepRecords.Value);

                        feedback.Success("Kept successfully");
                    }
                });
            }
            catch (Exception exception)
            {
                feedback.Failed("Keeping failed", exception);
            }

            WBLogging.Debug("Kept the document");

            RecordKeepingProgress.WBxUpdateTask(feedback);

            indexOfNextRecordToKeep++;

            NextRecordToKeep.Text = "" + indexOfNextRecordToKeep;

            if (indexOfNextRecordToKeep < recordIDs.Length)
            {
                Image image = (Image)RecordKeepingProgress.WBxFindNestedControlByID(RecordKeepingProgress.WBxMakeControlID(indexOfNextRecordToKeep.ToString(), "image"));
                image.ImageUrl = "/_layouts/images/WorkBoxFramework/processing-task-32.gif";

                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "TriggerNextStepFunction", "WorkBoxFramework_triggerKeepNextDocument();", true);
            }
            else
            {
                WBLogging.Debug("Trying to set button text to done");
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ChangeDoneButtonTextFunction", "WorkBoxFramework_finishedProcessing('Done');", true);
            }
        }