Exemple #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();
        }
		private void detach_Record(Record entity)
		{
			this.SendPropertyChanging();
			entity.aspnet_Users = null;
		}
 partial void DeleteRecord(Record instance);
 partial void UpdateRecord(Record instance);
 partial void InsertRecord(Record instance);
		private void detach_Record(Record entity)
		{
			this.SendPropertyChanging();
			entity.Site = null;
		}
		private void attach_Record(Record entity)
		{
			this.SendPropertyChanging();
			entity.Site = this;
		}