示例#1
0
        protected string FileList(HesterConsultants.AppCode.Entities.Job job)
        {
            StringBuilder sb = new StringBuilder();

            if (job.ReturnedFiles != null && job.SubmittedFiles != null)
            {
                sb.Append("<div style=\"border-top: dashed 1px #666666; line-height: normal;\">&nbsp;</span>");
            }

            if (job.ReturnedFiles != null)
            {
                sb.Append("Returned files:<ul>");
                foreach (JobFile file in job.ReturnedFiles)
                {
                    sb.Append("<li>");
                    sb.Append(SiteUtils.HighlightTermsInTextBlocks(file.Name, searchList, highlightTag, 10));
                    sb.Append("</li>");
                }
                sb.Append("</ul>");
            }

            if (job.SubmittedFiles != null)
            {
                sb.Append("Submitted files:<ul>");
                foreach (JobFile file in job.SubmittedFiles)
                {
                    sb.Append("<li>");
                    sb.Append(SiteUtils.HighlightTermsInTextBlocks(file.Name, searchList, Settings.Default.SearchHighlightHtmlTag, 10));
                    sb.Append("</li>");
                }
                sb.Append("</ul>");
            }

            return(sb.ToString());
        }
示例#2
0
        //private void EncodeInputValues()
        //{
        //    // allow users to put in angle brackets etc.
        //    // just escape them
        //    // to do - *done* take this out, leave angle brackets in,
        //    // just encode them on output
        //    this.txtDateDue.Text = this.Server.HtmlEncode(this.txtDateDue.Text);
        //    this.txtInstructions.Text = this.Server.HtmlEncode(this.txtInstructions.Text);
        //}

        private void InsertJob()
        {
            // check fields

            // job type
            int selectedJobTypeId = Convert.ToInt32(this.ddJobTypes.SelectedValue);

            if (selectedJobTypeId < minJobTypeId
                ||
                selectedJobTypeId > maxJobTypeId)
            {
                selectedJobTypeId = JobType.Other.JobTypeId;
            }

            JobType jobType = JobType.JobTypeFromId(selectedJobTypeId);

            string toApp     = String.Empty;
            bool   formatted = false;
            bool   proofed   = false;

            // job type options
            if (jobType.Equals(JobType.Conversion) || jobType.Equals(JobType.Editing))
            {
                if (jobType.Equals(JobType.Conversion))
                {
                    toApp = this.rbApplications.SelectedValue
                            + " " + this.rbVersions.SelectedValue;

                    formatted = this.rbFormatted.SelectedIndex == 0;
                }

                proofed = this.rbProof.SelectedIndex == 0;
            }

            // date submitted
            DateTime dateSubmitted = DateTime.UtcNow;

            // date due set earlier in btn handler
            //// convert to utc
            dateDue = ClientUtils.UtcForClientDate(curClient, dateDue);

            newJob                  = new HesterConsultants.AppCode.Entities.Job();
            newJob.Client           = curClient;
            newJob.BillingReference = this.txtBillingRef.Text.Trim();
            newJob.JobType          = jobType;
            newJob.ToApplication    = toApp;
            newJob.Formatted        = formatted;
            newJob.Proofread        = proofed;
            newJob.DateSubmitted    = dateSubmitted;
            newJob.DateDue          = newJob.OriginalDateDue = dateDue;
            newJob.Instructions     = this.txtInstructions.Text.Trim();
            newJob.Estimate         = 0m;
            newJob.FinalCharge      = 0m;
            newJob.Taxes            = 0m;

            CacheLayer.InsertJob(newJob);
        }
示例#3
0
 private void CheckJobIsForClient()
 {
     if (!curJob.Client.Equals(curClient)
         &&
         !User.IsInRole(Settings.Default.RoleAdmin))
     {
         curJob = null;
     }
 }
示例#4
0
        private bool CheckSelectedFileIsForClient()
        {
            //Client jobClient = null;
            bool ret = false;

            HesterConsultants.AppCode.Entities.Job job =
                HesterConsultants.AppCode.Entities.Job.JobFromId(jobFile.JobId);

            if (job != null)
            {
                //jobClient = HesterConsultants.AppCode.CacheLayer.ClientFromId(job.ClientId);
                ret = job.ClientId == curClient.ClientId;
            }

            return(ret);
        }
示例#5
0
        private void GetJob()
        {
            string qs    = this.Request.QueryString["jobId"];
            int    jobId = 0;

            if (!String.IsNullOrEmpty(qs))
            {
                jobId = Convert.ToInt32(qs);
            }

            //else
            //    jobId = (int?)this.Session[Global.SESSION_JOB_ID];

            if (jobId != 0)
            {
                curJob = CacheLayer.JobFromId((int)jobId);
            }
        }
示例#6
0
        protected string JobNumber(HesterConsultants.AppCode.Entities.Job job)
        {
            string s = SiteUtils.HighlightTermsInTextBlocks(job.JobId.ToString(), searchList, highlightTag, 5);

            return(s);
        }