public static void AddEntries(int _chartId, List<int> _entries) { PCMSofCCDataContext db = new PCMSofCCDataContext(); foreach (int id in _entries) { var newBelong = new EntryBelongToChart { ChartId = _chartId, EntryId = id }; db.EntryBelongToChart.InsertOnSubmit(newBelong); } db.SubmitChanges(); }
public static void AddChart(string _chartName, List<int> _entries) { PCMSofCCDataContext db = new PCMSofCCDataContext(); var newChart = new ScoreChart { Name = _chartName }; db.ScoreChart.InsertOnSubmit(newChart); foreach (int id in _entries) { var newBelong = new EntryBelongToChart { ScoreChart = newChart, EntryId = id }; db.EntryBelongToChart.InsertOnSubmit(newBelong); } db.SubmitChanges(); }
partial void DeleteEntryBelongToChart(EntryBelongToChart instance);
partial void UpdateEntryBelongToChart(EntryBelongToChart instance);
partial void InsertEntryBelongToChart(EntryBelongToChart instance);
private void detach_EntryBelongToChart(EntryBelongToChart entity) { this.SendPropertyChanging(); entity.ScoreEntry = null; }
private void attach_EntryBelongToChart(EntryBelongToChart entity) { this.SendPropertyChanging(); entity.ScoreChart = this; }