protected void rptWR_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Literal labelID = e.Item.FindControl("lblWID") as Literal; Literal labelHour = e.Item.FindControl("lblHours") as Literal; decimal needHours = wrApp.GetProposalTrackerHours(Convert.ToInt32(labelID.Text)); string link = string.Empty; if (!decimal.Equals(0, needHours)) { link = @"<a href='###' onclick='navigateToTimesheetReport(event," + labelID.Text + ")'>" + needHours + "</a>"; } labelHour.Text = link; } }
private void BindData(ProposalTrackerEntity entity) { ListItem li = ddlProject.Items.FindByValue(entity.ProjectID.ToString()); if (li == null) { ProjectsEntity projectEntity = new App.ProjectApplication().Get(entity.ProjectID); if (projectEntity != null) { ddlProject.Items.Insert(0, new ListItem() { Text = projectEntity.Title, Value = projectEntity.ID.ToString() }); } } else { li.Selected = true; } //ddlPayment.SelectedValue = entity.Payment.ToString(); //txtRequestNo.Text = entity.RequestNo; //txtInvoiceNo.Text = entity.InvoiceNo; ddlStatus.SelectedValue = entity.Status.ToString(); //txtDueDate.Text = entity.DueDate == null ? "" : ((DateTime)entity.DueDate).ToString("MM/dd/yyyy"); txtTitle.Text = entity.Title; txtDescription.Text = entity.Description; txtProposalSentTo.Text = entity.ProposalSentTo; txtProposalSentOn.Text = entity.ProposalSentOn == null ? "" : entity.ProposalSentOn.Value.ToShortDateString(); txtPO.Text = entity.PONo; chkLessThen.Checked = entity.PoTotalLessThenProposalTotal.Value; txtApprovedBy.Text = entity.ApprovedBy; txtApprovedOn.Text = entity.ApprovedOn == null ? "" : entity.ApprovedOn.Value.ToShortDateString(); //txtInvoiceSentOn.Text = entity.InvoiceSentOn == null ? "" : entity.InvoiceSentOn.Value.ToShortDateString(); StringBuilder sb = new StringBuilder(); sb.AppendFormat("<ul class=\"fileList\"><li><a href=\"/do/DoDownWrokRequestFile.ashx?ID={0}\" title='{1}' target=\"_blank\">{1}</a>" , entity.ProposalTrackerID, entity.WorkScopeDisplayName); sb.Append("</li></ul>"); lblFile.InnerHtml = sb.ToString(); rptNotes.DataSource = wrApp.GetProposalTrackerNotes(entity.ProposalTrackerID);; rptNotes.DataBind(); rptDocuments.DataSource = fileApp.GetFileListBySourceId(entity.ProposalTrackerID, FileSourceType.WorkRequest); rptDocuments.DataBind(); decimal hours = wrApp.GetProposalTrackerHours(QS("id", 0)); string link = string.Format("<a href='/Report/Timesheet.aspx?WID={0}'>{1}</a>", entity.ProposalTrackerID, hours.ToString("N")); litHours.Text = link; litProjectName.Text = ddlProject.SelectedItem.Text; this.rptTicketsList.DataSource = wrApp.GetAllRelation(entity.ProposalTrackerID); this.rptTicketsList.DataBind(); }