本文整理汇总了C#中Registration.GetLocations方法的典型用法代码示例。如果您正苦于以下问题:C# Registration.GetLocations方法的具体用法?C# Registration.GetLocations怎么用?C# Registration.GetLocations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registration
的用法示例。
在下文中一共展示了Registration.GetLocations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetPage
//.........这里部分代码省略.........
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();
}