Esempio n. 1
0
        private void DeleteFile(int fileId)
        {
            filesChanged = true;

            JobFile file = JobFile.JobFileFromId(fileId);

            // remove reference from Job
            Job job = CacheLayer.JobFromId(file.JobId);

            if (file.IsReturnedFile)
            {
                job.ReturnedFiles.Remove(file);
            }
            else if (file.IsSubmittedFile)
            {
                job.SubmittedFiles.Remove(file);
            }
            else
            {
                job.WorkingFiles.Remove(file);
            }

            // delete file
            file.Delete();
        }
Esempio n. 2
0
        private void GetSelectedFile()
        {
            //jobFile = CacheLayer.JobFileFromId(fileId);
            //if (jobFile == null)
            jobFile = JobFile.JobFileFromId(fileId);

            //Debug.WriteLine("GetSelectedFile(): " + jobFile.Name);
        }
Esempio n. 3
0
        private void TransmitJobFile(int fileId)
        {
            JobFile jobFile = JobFile.JobFileFromId(fileId);

            if (jobFile != null)
            {
                if (!jobFile.Job.IsArchived)
                {
                    this.Response.AppendHeader("Content-Disposition", "attachment; filename=" + jobFile.Name);
                    this.Response.TransmitFile(this.Server.MapPath(jobFile.Path));
                }
                else
                {
                    throw new Exception(SiteUtils.ExceptionMessageForCustomer("File is archived or removed per file retention policy."));
                }
            }
            //this.Response.End();
            HttpContext.Current.ApplicationInstance.CompleteRequest();
        }