/// <summary>
        /// Save a TaskRepository
        /// </summary>
        /// <param name="dc">DataContext</param>
        /// <param name="task"></param>
        /// <returns>returns the id of the saved task</returns>
        public int Save(DataContext dc, Domain.Task task)
        {
            dc = dc ?? Conn.GetContext();
            var dbTask = dc.Tasks.Where(t => t.TaskID == task.ID).SingleOrDefault();
            var isNew  = false;

            if (dbTask == null)
            {
                dbTask = new DataAccess.SqlRepository.Task();
                isNew  = true;
            }

            dbTask.SectionID   = task.SectionID;
            dbTask.StartTime   = task.StartTime;
            dbTask.EndTime     = task.StartTime.AddMinutes(task.Interval);
            dbTask.TaskTypeID  = task.TaskTypeId;
            dbTask.DateUpdated = DateTime.Now;

            if (isNew)
            {
                dbTask.DateCreated = DateTime.Now;
                dc.Tasks.InsertOnSubmit(dbTask);
            }
            dc.SubmitChanges();
            return(dbTask.TaskID);
        }
        /// <summary>
        /// Save a TaskRepository
        /// </summary>
        /// <param name="dc">DataContext</param>
        /// <param name="task"></param>
        /// <returns>returns the id of the saved task</returns>
        public int Save(DataContext dc, Domain.Task task)
        {
            dc = dc ?? Conn.GetContext();
            var dbTask = dc.Tasks.Where(t => t.TaskID == task.ID).SingleOrDefault();
            var isNew = false;
            if (dbTask == null)
            {
                dbTask = new DataAccess.SqlRepository.Task();
                isNew = true;
            }

            dbTask.SectionID = task.SectionID;
            dbTask.StartTime = task.StartTime;
            dbTask.EndTime = task.StartTime.AddMinutes(task.Interval);
            dbTask.TaskTypeID = task.TaskTypeId;
            dbTask.DateUpdated = DateTime.Now;

            if (isNew)
            {
                dbTask.DateCreated = DateTime.Now;
                dc.Tasks.InsertOnSubmit(dbTask);
            }
            dc.SubmitChanges();
            return dbTask.TaskID;
        }