Example #1
0
        public override void OnButtonClick(kCura.EventHandler.ConsoleButton consoleButton)
        {
            switch (consoleButton.Name)
            {
            case INSERT_JOB_BUTTON_NAME:
                //The user clicked the button for the insert job so add the job to the queue table on the EDDS database.
                System.Data.SqlClient.SqlParameter workspaceArtifactIDParam = new System.Data.SqlClient.SqlParameter("@WorkspaceArtifactID", System.Data.SqlDbType.Int)
                {
                    Value = this.Helper.GetActiveCaseID()
                };
                System.Data.SqlClient.SqlParameter jobArtifactIDParam = new System.Data.SqlClient.SqlParameter("@JobArtifactID", System.Data.SqlDbType.Int)
                {
                    Value = this.ActiveArtifact.ArtifactID
                };
                System.Data.SqlClient.SqlParameter searchArtifactIDParam = new System.Data.SqlClient.SqlParameter("@SourceSearchArtifactID", System.Data.SqlDbType.Int)
                {
                    Value = this.ActiveArtifact.Fields[SEARCH_FIELD_GUID.ToString()].Value.Value
                };


                //string searchArtifactID = this.ActiveArtifact.Fields.;

                //searchArtifactID = this.ActiveArtifact.

                this.Helper.GetDBContext(-1).ExecuteNonQuerySQLStatement(INSERT_JOB_QUERY, new System.Data.SqlClient.SqlParameter[] { workspaceArtifactIDParam, jobArtifactIDParam, searchArtifactIDParam });

                break;
            }
        }
 public override void OnButtonClick(kCura.EventHandler.ConsoleButton consoleButton)
 {
     switch (consoleButton.Name)
     {
         //Handle each Button's functionality
     }
 }
Example #3
0
        public override kCura.EventHandler.Console GetConsole(kCura.EventHandler.ConsoleEventHandler.PageEvent pageEvent)
        {
            //Construct a console object to build the console appearing in the UI.
            kCura.EventHandler.Console returnConsole = new kCura.EventHandler.Console
            {
                Items = new List <kCura.EventHandler.IConsoleItem>(),
                Title = CONSOLE_TITLE
            };

            //Construct the submit job button.
            kCura.EventHandler.ConsoleButton submitJobButton = new kCura.EventHandler.ConsoleButton
            {
                Name           = INSERT_JOB_BUTTON_NAME,
                DisplayText    = INSERT_JOB_DISPLAY_TEXT,
                ToolTip        = INSERT_JOB_TOOL_TIP,
                RaisesPostBack = true
            };

            //If a job is already in the queue, change the text and disable the button.
            if (pageEvent == PageEvent.PreRender)
            {
                System.Data.SqlClient.SqlParameter workspaceArtifactIDParam = new System.Data.SqlClient.SqlParameter("@WorkspaceArtifactID", System.Data.SqlDbType.Int)
                {
                    Value = this.Helper.GetActiveCaseID()
                };

                System.Data.SqlClient.SqlParameter jobArtifactIDParam = new System.Data.SqlClient.SqlParameter("@JobArtifactID", System.Data.SqlDbType.Int)
                {
                    Value = this.ActiveArtifact.ArtifactID
                };

                int jobCount = this.Helper.GetDBContext(-1).ExecuteSqlStatementAsScalar <Int32>(JOB_EXISTS_QUERY, new System.Data.SqlClient.SqlParameter[] { workspaceArtifactIDParam, jobArtifactIDParam });

                //Use the helper function to check if a job currently exists. Set Enabled to the opposite value.
                if (jobCount > 0)
                {
                    submitJobButton.Enabled = false;
                }
                else
                {
                    submitJobButton.Enabled = true;
                }
            }

            //Add the buttons to the console.
            returnConsole.Items.Add(submitJobButton);

            return(returnConsole);
        }
        public override kCura.EventHandler.Console GetConsole(PageEvent pageEvent)
        {
            // Construct a console object to build the console appearing in the UI.
            kCura.EventHandler.Console returnConsole = new kCura.EventHandler.Console();
            returnConsole.Items = new List <kCura.EventHandler.IConsoleItem>();
            returnConsole.Title = CONSOLE_TITLE;

            // Construct the reporting button.
            kCura.EventHandler.ConsoleButton button = new kCura.EventHandler.ConsoleButton();
            button.Name           = BUTTON_NAME;
            button.DisplayText    = BUTTON_DISPLAY_TEXT;
            button.ToolTip        = BUTTON_TOOL_TIP;
            button.RaisesPostBack = false;
            button.Enabled        = true;

            //Create the JavaScript for the button and set the button "OnClickEvent" property.
            button.OnClickEvent = "alert('Imagine that I am a report on the current person\\\'s enthusiasm');";

            returnConsole.Items.Add(button);

            return(returnConsole);
        }