public void lbtnCopyAssignments_Clicked(object sender, EventArgs e) { LinkButton lbtnCopyAssignments = (LinkButton)sender; Guid retreatId = new Guid(lbtnCopyAssignments.Attributes["retreatid"]); Monks.jkp_Retreat retreat = db.jkp_Retreats.First(p => p.Ret_ID == retreatId); foreach (Monks.jkp_Assignment assignment in retreat.jkp_Assignments) { Monks.jkp_Assignment newAssignment = new Monks.jkp_Assignment(); newAssignment.Assn_Comment = assignment.Assn_Comment; newAssignment.Assn_Description = assignment.Assn_Description; newAssignment.Assn_ID = Guid.NewGuid(); newAssignment.Assn_Name = assignment.Assn_Name; newAssignment.Assn_RetreatId = RetreatId; db.jkp_Assignments.InsertOnSubmit(newAssignment); } db.SubmitChanges(); mvCopy.ActiveViewIndex = 1; }
public void btnCreateAssnSave_Clicked(object sender, EventArgs e) { Monks.jkp_Assignment assignment = new Monks.jkp_Assignment(); assignment.Assn_ID = Guid.NewGuid(); assignment.Assn_Name = txtCreateAssnName.Text; assignment.Assn_Description = txtDescription.Text; assignment.Assn_RetreatId = RetreatId; db.jkp_Assignments.InsertOnSubmit(assignment); db.SubmitChanges(); modalCreateAssignment.Hide(); }
private void detach_jkp_Assignments(jkp_Assignment entity) { this.SendPropertyChanging(); entity.jkp_Retreat = null; }