コード例 #1
0
 /// <summary>
 /// Writing task session changes to DB
 /// </summary>
 /// <param name="id"></param>
 /// <param name="time"></param>
 /// <param name="name"></param>
 public void UpdateSession(TaskInfo entity)
 {
     if (GetByTaskBoxId(_taskID) == null)
     {
         MessageBox.Show("ERROR: Task not found in DB. Skip savig...");
         return;
     }
     entity.Name = Name;
     entity.TrackedTime = Time;
     _taskEntities.SaveChanges();
 }
コード例 #2
0
        public void InsertSession(TaskInfo entity)
        {
            try
                {
                    _currentProject.ProjectTasks.Add(entity);
                }
                catch (Exception ex)
                {

                    _currentProject.ProjectTasks = new List<TaskInfo>();
                }
                finally
                {
                    _taskEntities.SaveChanges();
                }
        }