Example #1
0
        protected void rptCruseCharter_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var cruiseCharterRange = e.Item.DataItem as QCruiseCharterRange;

            if (cruiseCharterRange != null)
            {
                var litCruiseName = e.Item.FindControl("litCruiseName") as Literal;
                if (litCruiseName != null)
                {
                    litCruiseName.Text = string.Format("{0} {1} cabins", cruiseCharterRange.Cruise.Name, cruiseCharterRange.Cruise.Rooms.Count);
                }
                var listRange = _module.GetCruiseCharterRange(cruiseCharterRange.Group).Where(c => c.Cruise == cruiseCharterRange.Cruise);
                var rptCharterRangerHeader = e.Item.FindControl("rptCharterRangerHeader") as Repeater;
                if (rptCharterRangerHeader != null && cruiseCharterRange.CharterRangeConfig != null)
                {
                    rptCharterRangerHeader.DataSource = listRange;
                    rptCharterRangerHeader.DataBind();
                }
                var rptCharterRanger = e.Item.FindControl("rptCharterRanger") as Repeater;
                if (rptCharterRanger != null)
                {
                    rptCharterRanger.DataSource = listRange;
                    rptCharterRanger.DataBind();
                }
            }
        }