public ProjectTasks(string name)
 {
     _tasks = new ObservableCollection<TaskBox>();
     InitializeComponent();
     _db = new ProjectInfoContext();
     taskCounter = getMaxTaskID() + 1;
     _freelancerMode = false;
     _task = new TaskModel(taskCounter, _currentProject);
     _task.CreateDB();
     LoadTaskSessions();
 }
 public TaskBox(int taskID, int projectId)
 {
     InitializeComponent();
     textBlock.Tag = ID;
     this._model = new TaskModel(taskID, projectId);
     _model.CreateDB();
     this.DataContext = this._model;
     if (_model.DBContext.TaskDataEntities.Count() > 0)
     {
         btnTimer.Content = "Resume";
     }
     else
     {
         btnTimer.Content = "Start";
     }
 }
 /// <summary>
 /// Creating a TaskBox item with enebled Freelancer Mode and hour rate
 /// </summary>
 /// <param name="taskID">№ of a taskbox item, ordered by ascending</param>
 /// <param name="logged">A raw representation of the logged time(without formatting)</param>
 /// <param name="name">Name of task</param>
 /// <param name="rate">Rate per hours(freelancer mode availeble only)</param>
 public TaskBox(int taskID, int logged, string name, float rate, ProjectDescription project)
 {
     InitializeComponent();
     textBlock.Tag = ID;
     this._model = new TaskModel(taskID, logged, name, project);
     _model.CreateDB();
     this.DataContext = this._model;
     if (_model.DBContext.TaskDataEntities.Count() > 0)
     {
         btnTimer.Content = "Resume";
     }
     else
     {
         btnTimer.Content = "Start";
     }
     _model.HourRate = rate;
 }