当前位置: 首页>>代码示例>>C#>>正文


C# Registration.GetLocations方法代码示例

本文整理汇总了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();
        }
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:101,代码来源:IndoorRegistration.ascx.cs


注:本文中的Registration.GetLocations方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。