private void LoadJob()
        {
            job      = new JobInstance(RegistryContext);
            job.Guid = guid;
            job.Load();

            // Check user ID
            if (IsAuthenticatedUser(job.UserGuidOwner))
            {
                throw new Registry.SecurityException("Access denied.");  // TODO
            }

            // Get query details
            ej = JobDescriptionFactory.GetJobDescription(job);
        }
Exemple #2
0
        protected void Button_Command(object sender, CommandEventArgs e)
        {
            if (IsValid)
            {
                var guid  = new Guid(JobList.SelectedDataKeys.First());
                var guids = JobList.SelectedDataKeys.Select(i => new Guid(i)).ToArray();

                switch (e.CommandName)
                {
                case "Download":
                    var job = new JobInstance(RegistryContext);
                    job.Guid = guid;
                    job.Load();

                    if (job.JobExecutionStatus == JobExecutionState.Completed)
                    {
                        // Get query details
                        var ej = JobDescriptionFactory.GetJobDescription(job);

                        Response.Redirect(GetExportUrl(ej));
                    }
                    else
                    {
                        JobNotCompleteValidator.IsValid = false;
                    }
                    break;

                case "View":
                    Response.Redirect(Jhu.Graywulf.Web.UI.Jobs.ExportJobDetails.GetUrl(guid));
                    break;

                case "Cancel":
                    Response.Redirect(Jhu.Graywulf.Web.UI.Jobs.CancelJob.GetUrl(guids));
                    break;

                default:
                    throw new NotImplementedException();
                }
            }
        }
        private void RedirectToDetails(Guid guid)
        {
            var job = new JobInstance(RegistryContext);

            job.Guid = guid;
            job.Load();

            var wjob = JobDescriptionFactory.GetJobDescription(job);

            switch (wjob.JobType)
            {
            case JobType.Query:
                Response.Redirect(QueryJobDetails.GetUrl(guid));
                break;

            case JobType.ExportTable:
                Response.Redirect(ExportJobDetails.GetUrl(guid));
                break;

            default:
                throw new NotImplementedException();
            }
        }