Exemplo n.º 1
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if (TeamCB.SelectedIndex == -1)
                return;

            UserTeam ut = new UserTeam();
            ut.Team = Convert.ToInt16((TeamCB.Items[TeamCB.SelectedIndex] as ComboBoxItem).Tag);
            ut.User = WebContext.Current.User.Name;

            domainContext.UserTeams.Add(ut);
            domainContext.SubmitChanges();
            this.DialogResult = true;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the UserTeam EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUserTeam(UserTeam userTeam)
 {
     base.AddObject("UserTeam", userTeam);
 }
 /// <summary>
 /// Create a new UserTeam object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="user">Initial value of the User property.</param>
 /// <param name="team">Initial value of the Team property.</param>
 public static UserTeam CreateUserTeam(global::System.Int32 id, global::System.String user, global::System.Int32 team)
 {
     UserTeam userTeam = new UserTeam();
     userTeam.id = id;
     userTeam.User = user;
     userTeam.Team = team;
     return userTeam;
 }
 private bool FilterUserTeam(UserTeam entity)
 {
     return (entity.Team == this.Id);
 }
 private void DetachUserTeam(UserTeam entity)
 {
     entity.Resource = null;
 }
 private void AttachUserTeam(UserTeam entity)
 {
     entity.Resource = this;
 }