/// <summary> /// When the create button is clicked, we inform the world to commit changes. /// </summary> private void ButtonCreate_Click(object sender, EventArgs e) { var lProject = new Project(); lProject.Name = this.mTextBoxTitle.Name; lProject.Description = this.mTextPreviewViewBody.Text; lProject.CreationDateTIme = DateTime.UtcNow; using (var lDataContext = new IssueTrackerDataContext()) { var lProjectUser = new ProjectUser(); lProjectUser.Project = lProject; lProjectUser.User = lDataContext.CurrentUser; lDataContext.Projects.InsertOnSubmit(lProject); lDataContext.ProjectUsers.InsertOnSubmit(lProjectUser); lDataContext.SubmitChanges(); } this.ProjectCreated.Fire(this, ReadOnlyValueEventArgs.Create(lProject)); }
private void detach_ProjectUsers(ProjectUser entity) { this.SendPropertyChanging(); entity.User = null; }
private void attach_ProjectUsers(ProjectUser entity) { this.SendPropertyChanging(); entity.User = this; }
partial void DeleteProjectUser(ProjectUser instance);
partial void UpdateProjectUser(ProjectUser instance);
partial void InsertProjectUser(ProjectUser instance);