private void SetJobFields() { // other fields this.lblHeadingJobNumber.Text = curJob.JobId.ToString(); this.lblStatus.Text = curJob.JobStatus.Name; DateTime dateSubmitted = AdminUtils.EmployeeDate(curJob.DateSubmitted, curAdmin); this.lblDateSubmitted.Text = dateSubmitted.ToString("M/d/yyyy h:mm tt"); DateTime dateDue = AdminUtils.EmployeeDate(curJob.DateDue, curAdmin); this.lblDateDue.Text = dateDue.ToString("M/d/yyyy h:mm tt"); if (curJob.JobStatus.IsAClosedStatus()) { DateTime dateCompleted = AdminUtils.EmployeeDate(curJob.DateCompleted, curAdmin); this.lblStatus.Text += " at " + dateCompleted.ToString("M/d/yyyy h:mm tt"); } this.lblBillingRef.Text = this.Server.HtmlEncode(curJob.BillingReference); this.lblJobType.Text = curJob.JobType.Name; this.phInstructions.Controls.Add( new LiteralControl(SiteUtils.SurroundTextBlocksWithHtmlTags(curJob.Instructions, "div", null))); }
protected DateTime DateForEmployee(DateTime dt) { if (curAdmin != null) { return(AdminUtils.EmployeeDate(dt, curAdmin)); } else { return(DateTime.MinValue); } }
private void SetControls() { // link to send message this.pnlSendMessage.Controls.Add(new LiteralControl("<a href=\"./ClientMessage.aspx?jobId=" + curJob.JobId.ToString() + "\">Send client a message</a>")); this.pnlViewSegments.Controls.Add(new LiteralControl("<a href=\"/employees/Work.aspx?jobId=" + curJob.JobId.ToString() + "\">View work</a>")); // files if (filesChanged) { SetFileLists(); // we called this earlier on page_load, so only do it again if } // added or deleted a file. // job no. this.lblHeadingJobNumber.Text = curJob.JobId.ToString(); // client this.lblClient.Text = this.Server.HtmlEncode(curJob.Client.FirstName + " " + curJob.Client.LastName); // status this.ddStatuses.SelectedValue = curJob.JobStatus.JobStatusId.ToString(); // job type this.ddJobTypes.SelectedValue = curJob.JobType.JobTypeId.ToString(); // job type options this.txtToApplication.Text = curJob.ToApplication; this.chkFormatted.Checked = curJob.Formatted; this.chkProofed.Checked = curJob.Proofread; // date submitted DateTime dateSubmittedInAdminZone = AdminUtils.EmployeeDate(curJob.DateSubmitted, curAdmin); this.lblDateSubmitted.Text = dateSubmittedInAdminZone.ToString("M/d/yyyy h:mm tt"); // billing this.txtBillingRef.Text = curJob.BillingReference; // date due DateTime dateDueInAdminZone = AdminUtils.EmployeeDate(curJob.DateDue, curAdmin); this.txtDateDue.Text = dateDueInAdminZone.ToString("M/d/yyyy h:mm tt"); // original date due DateTime originalDateDueInAdminZone = AdminUtils.EmployeeDate(curJob.OriginalDateDue, curAdmin); if (originalDateDueInAdminZone != dateDueInAdminZone) { phOrigDateDue.Controls.Add(new LiteralControl("<br />Original Date Due: " + originalDateDueInAdminZone.ToString("M/d/yyyy h:mm tt"))); } // date completed if (curJob.DateCompleted > DateTime.MinValue) { DateTime dateCompleted = AdminUtils.EmployeeDate(curJob.DateCompleted, curAdmin); this.txtDateCompleted.Text = dateCompleted.ToString("M/d/yyyy h:mm tt"); //this.phCompletedDate.Controls.Add(new LiteralControl(" at " + dateCompleted.ToString("M/d/yyyy h:mm tt"))); } // estimate this.txtEstimate.Text = curJob.Estimate.ToString("c"); // final charge this.txtFinalCharge.Text = curJob.FinalCharge.ToString("c"); // taxes this.txtTaxes.Text = curJob.Taxes.ToString("c"); // instructions this.txtInstructions.Text = curJob.Instructions; // delivery notes this.txtNotes.Text = curJob.DeliveryNotes; // archived this.chkArchive.Checked = curJob.IsArchived; // iOs attrs SiteUtils.AddTextBoxAttributes(this, "autocorrect", "off", true); SiteUtils.AddTextBoxAttributes(this, "autocapitalize", "off", true); }