public void DeleteActivityHistory(long logId) { ActivityLogData log = getActivityLog(logId); if (log is QLogData) { ICollection <AnswerByPhoneData> answersData = ((QLogData)log).studentsAnswers; deleteAnswers(answersData); } ActivityLogs.Remove(log); SaveChanges(); }
public static ActivityLog getActivityLogFromData(ActivityLogData activityLogData) { ActivityLog al = new ActivityLog(); al.ActivityName = activityLogData.ActivityName; al.date = activityLogData.date; al.expID = activityLogData.expID; al.id = activityLogData.id; al.isMainActivity = activityLogData.isMainActivity; al.RoomId = activityLogData.RoomId; return al; }
public void addActivityLog(ActivityLogData activityLog) { ActivityLogs.Add(activityLog); SaveChanges(); }