Beispiel #1
0
        public Task(string name, string description, Estimate estimation, DateTime taskEndDate, long _columnId, long _employId)
        {
            Name        = name;
            Description = description;
            Estimation  = estimation.estimateId;
            TaskEndDate = taskEndDate;

            AddToBoardDate = DateTime.Now;
            LastModifyDate = DateTime.Now;

            columnId = _columnId;
            employId = _employId;

            this.ValidateDates(AddToBoardDate, TaskEndDate);
        }
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string name        = txtName.Text;
                string description = txtDescription.Text;

                long employId     = BoardDB.GetEmployees().ToList().First(employ => employ.ToString() == cbAssignee.Text).employId;
                long openColumnId = Board.GetKeyForValue("Open", Board.Columns).columnId;

                Estimate estimation = Board.GetKeyForValue <Estimate>(cbEstimation.Text, Board.Estimates);
                DateTime endDate    = (DateTime)pickerDateEnd.SelectedDate;

                Task newTask = new Task(name, description, estimation, endDate, openColumnId, employId);
                Board.AddNewTaskToBoard(newTask);

                this.NavigationService.GoBack();
            }
            catch (InvalidOperationException err)
            {
                lblError.Content = $"{err.Message}";
            }
        }
Beispiel #3
0
 public Task(string name, string description, Estimate estimation) : this(name, description, estimation, DateTime.Now.AddDays(30), 0, 0)
 {
 }