protected void rptBookings_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.DataItem is Booking) { var booking = (Booking)e.Item.DataItem; if (booking.GuideCollectedRemain + booking.AgencyRemain == 0) { e.Item.Visible = false; return; } ValueBinder.BindLiteral(e.Item, "litGuideRemain", booking.GuideCollectedRemain); ValueBinder.BindLiteral(e.Item, "litPartnerRemain", booking.AgencyRemain); ValueBinder.BindLiteral(e.Item, "litService", booking.Trip.Name); var hplBookingCode = (HyperLink)e.Item.FindControl("hplBookingCode"); if (hplBookingCode != null) { hplBookingCode.Text = Module.BookingCode(booking); hplBookingCode.NavigateUrl = string.Format( "BookingView.aspx?NodeId={0}&SectionId={1}&bookingid={2}", Node.Id, Section.Id, booking.Id); } var hplDate = (HyperLink)e.Item.FindControl("hplDate"); hplDate.Text = booking.StartDate.ToString("dd/MM/yyyy"); if (booking.Agency != null && booking.Agency.Sale != null) { var hplSale = (HyperLink)e.Item.FindControl("hplSale"); hplSale.Text = booking.Agency.Sale.AllName; } if (booking.Agency != null) { var hplPartner = (HyperLink)e.Item.FindControl("hplPartner"); hplPartner.Text = booking.Agency.Name; } var aPayment = e.Item.FindControl("aPayment") as HtmlAnchor; if (aPayment != null) { string url = string.Format("BookingPayment.aspx?NodeId={0}&SectionId={1}&BookingId={2}", Node.Id, Section.Id, booking.Id); aPayment.Attributes.Add("onclick", CMS.ServerControls.Popup.OpenPopupScript(url, "Payment", 600, 500)); } if (UserIdentity.HasPermission(AccessLevel.Administrator)) { if (booking.GuideCollectedRemain != 0 && booking.GuideCollected && !booking.GuideConfirmed) { ValueBinder.ShowControl(e.Item, "lbtGuideConfirm"); } if (booking.AgencyRemain != 0 && booking.IsPaid && !booking.AgencyConfirmed) { ValueBinder.ShowControl(e.Item, "lbtAgencyConfirm"); } if (Math.Abs(booking.AgencyRemain) > 10 || Math.Abs(booking.GuideCollectedRemain) > 10) { var trRow = (HtmlTableRow)e.Item.FindControl("trRow"); trRow.Style.Add("background-color", "#FBFB00"); } if (Math.Abs(booking.AgencyRemain) > 200 || Math.Abs(booking.GuideCollectedRemain) > 200) { var trRow = (HtmlTableRow)e.Item.FindControl("trRow"); trRow.Style.Add("background-color", "#FF7F7F"); } } } }