예제 #1
0
        public static void AddRecord(DateTime _date, Guid _userId, int _siteId, int _chartId)
        {
            PCMSofCCDataContext db = new PCMSofCCDataContext();
            var newRecord = new Record
            {
                Date = _date.Date,
                UserId = _userId,
                SiteId = _siteId,
                ChartId = _chartId
            };
            db.Record.InsertOnSubmit(newRecord);

            var entries =
                from belong in db.EntryBelongToChart
                where belong.ChartId == _chartId
                select belong.ScoreEntry;
            foreach (var entry in entries)
            {
                var newRecordEntry = new RecordEntry
                {
                    Record = newRecord,
                    ScoreEntry = entry,
                };
                db.RecordEntry.InsertOnSubmit(newRecordEntry);
            }
            db.SubmitChanges();
        }
예제 #2
0
 partial void DeleteRecordEntry(RecordEntry instance);
예제 #3
0
 partial void UpdateRecordEntry(RecordEntry instance);
예제 #4
0
 partial void InsertRecordEntry(RecordEntry instance);
예제 #5
0
		private void detach_RecordEntry(RecordEntry entity)
		{
			this.SendPropertyChanging();
			entity.ScoreEntry = null;
		}
예제 #6
0
		private void attach_RecordEntry(RecordEntry entity)
		{
			this.SendPropertyChanging();
			entity.Record = this;
		}