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;\"> </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()); }
//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); }
private void CheckJobIsForClient() { if (!curJob.Client.Equals(curClient) && !User.IsInRole(Settings.Default.RoleAdmin)) { curJob = null; } }
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); }
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); } }
protected string JobNumber(HesterConsultants.AppCode.Entities.Job job) { string s = SiteUtils.HighlightTermsInTextBlocks(job.JobId.ToString(), searchList, highlightTag, 5); return(s); }