protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (this.DataSource == null || this.DataSource.Id == null) { this.CourseName.IsReadOnly = UserInterface.ConfigurableBoolean.False; this.Element.FieldValue = true; this.ShowOnBooking.FieldValue = true; } else { this.MainSession.IsReadOnly = this.DataSource.SessionXrefMaster.MainSession == 1 ? UserInterface.ConfigurableBoolean.True : UserInterface.ConfigurableBoolean.False; } if (this.DataSource != null) { this.BookedPlaces.FieldValue = (this.DataSource.MaxPlaces - this.DataSource.FreePlaces).ToString(); } this.SelectionGroup.DataSource = CourseSelectGroups.FetchAllByEventId(this.ParentEventId); this.CourseName.ClientOnChange = @" if (this.getData()){ $('#" + this.Name.ClientID + "Field').val(this.getData().prod_name); $('#" + this.VATCode.ClientID + "Field').val(this.getData().prod_vat_code); }"; this.Real.FieldValue = "1"; this.DataSource.SessionXrefMaster.Real = 1; }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (this.Id.FieldValue == "") { this.Element.FieldValue = true; this.InvoicePrint.FieldValue = true; this.ShowSales.FieldValue = true; } this.SelectionGroup.DataSource = CourseSelectGroups.FetchAllByEventId(this.ParentEventId); this.ProductEvent.ClientOnChange = @" if (this.getData()) $('#" + this.VATCode.ClientID + "Field').val(this.getData().prod_vat_code); "; }