コード例 #1
0
        private void GetRandomSponsor()
        {
            if (App.Sponsors == null)
            {
                App.Sponsors = new ObservableCollection<Sponsor>();
            }
            if (App.Sponsors.Count == 0)
            {
                this.RandomSponsor = new Sponsor
                {
                    Name = "ONETUG",
                    Url = "http://www.onetug.org",
                    Image = "/Images/CodeCamp-Small.png",
                    Description = "The Orlando .Net User Group",
                    SponsorshipLevel = new SponsorshipLevel { Name = "Organizer" }
                };
            }
            else
            {
                RandomSponsor = App.Sponsors.NextRandom();

            }
            this.RandomSponsorGrid.DataContext = RandomSponsor;
        }
コード例 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Sponsors EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSponsors(Sponsor sponsor)
 {
     base.AddObject("Sponsors", sponsor);
 }
コード例 #3
0
 /// <summary>
 /// Create a new Sponsor object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="eventId">Initial value of the EventId property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 /// <param name="approvalStatus">Initial value of the ApprovalStatus property.</param>
 /// <param name="sponsorshipLevelId">Initial value of the SponsorshipLevelId property.</param>
 /// <param name="url">Initial value of the Url property.</param>
 /// <param name="image">Initial value of the Image property.</param>
 public static Sponsor CreateSponsor(global::System.Int32 id, global::System.Int32 eventId, global::System.String name, global::System.String description, global::System.String approvalStatus, global::System.Int32 sponsorshipLevelId, global::System.String url, global::System.String image)
 {
     Sponsor sponsor = new Sponsor();
     sponsor.Id = id;
     sponsor.EventId = eventId;
     sponsor.Name = name;
     sponsor.Description = description;
     sponsor.ApprovalStatus = approvalStatus;
     sponsor.SponsorshipLevelId = sponsorshipLevelId;
     sponsor.Url = url;
     sponsor.Image = image;
     return sponsor;
 }