private void SetPage() { btnFindTimeSlot.Text = Translate.Text("Continue"); btnSelectTimeSlot.Text = Translate.Text("Continue"); btnPersonalDetails.Text = Translate.Text("Submit Now"); btnResetTimeSlot.Text = Translate.Text("Reset"); btnResetForm.Text = Translate.Text("Reset"); cvFindTimeSlotUnavailable.ErrorMessage = Translate.Text("<p>Sorry, there are no times available for this date. Please select another time slot.</p>"); cvFindTimeSlotError.ErrorMessage = Translate.Text("<p>Sorry, the booking system is not available right now - please try again later.</p>"); cvSelectTimeSlotUnavailable.ErrorMessage = Translate.Text("<p>Sorry, there are no spaces left for this time. Please select another time slot.</p>"); cvSelectTimeSlotError.ErrorMessage = Translate.Text("<p>Sorry, the booking system is not available right now - please try again later.</p>"); cvSubmitSubscription.ErrorMessage = Translate.Text("<p>Sorry, the booking system is not available right now - please try again later.</p>"); string val = Translate.Text("Please enter {0}"); rfvFirstName.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a first name"))); revFirstName.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid first name"))); rfvSurname.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a surname"))); revSurname.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid surname"))); cvDateOfBirth.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid date of birth"))); rfvAddressLine1.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("an address"))); revAddressLine1.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid address"))); //rfvAddressLine2.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("an address"))); revAddressLine2.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid address"))); rfvAddressLine3.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("an address"))); revAddressLine3.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid address"))); rfvPostcode.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a postcode"))); revPostcode.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid postcode"))); rfvPhoneNumber.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a phone number"))); revPhoneNumber.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid phone number"))); rfvEmail.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("an email address"))); revEmail.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid email address"))); rfvNOKFirstName.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a name"))); revNOKFirstName.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid name"))); rfvNOKSurname.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a surname"))); revNOKSurname.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid surname"))); rfvNOKRelationship.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("your relationship"))); revNOKRelationship.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid relationship"))); rfvNOKPhoneNumber.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a phone number"))); revNOKPhoneNumber.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid phone number"))); cvTermsAndConditions.ErrorMessage = "<p>Please agree to the terms and conditions</p>"; //optional fields revFirstName2.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid first name"))); revSurname2.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid surname"))); revFirstName3.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid first name"))); revSurname3.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid surname"))); revTeamName.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid team name"))); cvDateOfBirth2.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid date of birth"))); cvDateOfBirth3.ErrorMessage = String.Format("<p>{0}</p>", String.Format(val, Translate.Text("a valid date of birth"))); //regular expressions validators revFirstName.ValidationExpression = Settings.NameRegularExpression; revSurname.ValidationExpression = Settings.NameRegularExpression; revNOKFirstName.ValidationExpression = Settings.NameRegularExpression; revNOKSurname.ValidationExpression = Settings.NameRegularExpression; revFirstName2.ValidationExpression = Settings.NameRegularExpression; revSurname2.ValidationExpression = Settings.NameRegularExpression; revFirstName3.ValidationExpression = Settings.NameRegularExpression; revSurname3.ValidationExpression = Settings.NameRegularExpression; revAddressLine1.ValidationExpression = Settings.AddressLineRegularExpression; revAddressLine2.ValidationExpression = Settings.AddressLineRegularExpression; revAddressLine3.ValidationExpression = Settings.AddressLineRegularExpression; revPostcode.ValidationExpression = Settings.PostcodeRegularExpression; revEmail.ValidationExpression = Settings.EmailAddressRegularExpression; revPhoneNumber.ValidationExpression = Settings.PhoneNumberRegularExpression; revTeamName.ValidationExpression = Settings.AddressLineRegularExpression; revNOKRelationship.ValidationExpression = Settings.GeneralTextRegularExpression; revNOKPhoneNumber.ValidationExpression = Settings.PhoneNumberRegularExpression; //Radio Buttons radAMRaceTime.Text = Translate.Text("AM"); radPMRaceTime.Text = Translate.Text("PM"); radIndividual.Text = Translate.Text("Individual"); radGroup.Text = Translate.Text("Team"); radMember.Text = Translate.Text("Member"); radNonMember.Text = Translate.Text("Non-member"); radStaff.Text = Translate.Text("Staff"); radMale.Text = Translate.Text("Male"); radFemale.Text = Translate.Text("Female"); radMale2.Text = Translate.Text("Male"); radFemale2.Text = Translate.Text("Female"); radMale3.Text = Translate.Text("Male"); radFemale3.Text = Translate.Text("Female"); clubFindSelect.Items.Clear(); clubFindSelect.Items.Add(new ListItem(Translate.Text("Select a club"), "")); ////Get the races from sitecore Item races = Sitecore.Context.Database.GetItem(ItemPaths.IndoorTriathlonRaces); if (races != null && races.HasChildren) { List<DropDownItem> raceList = races.Children.ToList().ConvertAll(X => new DropDownItem(X)); int counter = 1; raceList.ForEach((delegate(DropDownItem race) { var radioRace = this.FindControl("radRace" + counter.ToString()) as System.Web.UI.WebControls.RadioButton; if (radioRace != null) { radioRace.Text = Translate.Text(race.Value.Rendered); } counter++; })); } ////Get the dates from sitecore drpRaceDate.Items.Clear(); drpRaceDate.Items.Add(new ListItem(Translate.Text("Select a date"), "")); Item dates = Sitecore.Context.Database.GetItem(ItemPaths.IndoorTriathlonEventDates); if (dates != null && dates.HasChildren) { List<DateItem> dateList = dates.Children.ToList().ConvertAll(X => new DateItem(X)); foreach (DateItem date in dateList) { drpRaceDate.Items.Add(new ListItem(date.Dateentry.DateTime.ToString("dddd MMMM d, yyyy"), date.Dateentry.DateTime.ToString("dd/MM/yyyy"))); } } try { //Bind clubs drop down list Registration vs = new Registration(); //Add Authentication //vs.PreAuthenticate = true; //NetworkCredential myCred = new NetworkCredential("VARegistration", "cr34m t34", ""); //CredentialCache myCache = new CredentialCache(); //myCache.Add(new Uri(vs.Url), "Basic", myCred); //vs.Credentials = myCache; //New code added - alternate way of passing user credentials vs.UserCredentialsValue = getCredentails(); //Get the club names from webservice Transaction trans = vs.GetLocations(); if (trans.Locations != null) { foreach (Location location in trans.Locations) { if (!String.IsNullOrEmpty(location.Title)) { ListItem lst = new ListItem(location.Title, location.Id.ToString()); clubFindSelect.Items.Add(lst); } } } } catch (Exception ex) { Log.Error(String.Format("Error retrieving Indoor Triathlon clubs: {0}", ex.Message), this); //Error -Display message cvFindTimeSlotError.IsValid = false; } //Update Page pnlForm.Update(); }