Пример #1
0
        private void UpdateProjectTitle(object param)
        {
            if (string.Equals(_project.Header, ProjectTitle.Trim()))
            {
                return;
            }

            if (!ValidateUserInput.IsNullOrWhiteSpace(ProjectTitle))
            {
                ProjectTitle = _project.Header;
                return;
            }
            _projectPath = $".{Path.DirectorySeparatorChar}Projects{Path.DirectorySeparatorChar}{ProjectTitle}{Path.DirectorySeparatorChar}";
            try
            {
                Directory.Move(_project.Path, _projectPath.Substring(2));
            }
            catch
            {
                ProjectTitle = _project.Header;
                MessageBox.Show("That project already exist");
                return;
            }
            _project.Header = ProjectTitle;
            _project.Path   = _projectPath;
            DataBase.UpdateProject((Project)_project);
        }
Пример #2
0
        public void AddComment()
        {
            if (!ValidateUserInput.IsNullOrWhiteSpace(CommentContent))
            {
                return;
            }


            if (_editableComment != null)
            {
                var index = Notes.IndexOf(_editableComment);
                _editableComment.Content = CommentContent;
                _editableComment.Header  = CommentHeader;
                Notes.Insert(index, _editableComment);
                Notes.RemoveAt(index + 1);
                DataBase.UpdateComment(_editableComment);
                _editableComment = null;
            }
            else
            {
                var comment = new Comment
                {
                    SubmitionDate = DateTime.Now,
                    Content       = CommentContent,
                    Header        = CommentHeader
                };
                DataBase.InsertComment(comment, _project.ID);
                Notes.Add(comment);
            }
            CommentContent = string.Empty;
            ShowAddNotePanel();
        }
Пример #3
0
        private void UpdateProjectDescription(object param)
        {
            if (!ValidateUserInput.IsNullOrWhiteSpace(Description))
            {
                Description = _project.Content;
                return;
            }

            _project.Content = Description;
            DataBase.UpdateProject((Project)_project);
        }
Пример #4
0
 public bool CanSaveTask(string taskContent)
 {
     return(ValidateUserInput.IsNullOrWhiteSpace(taskContent));
 }
Пример #5
0
 public bool CanAddNewContributor(string firstName, string lastName)
 {
     return(ValidateUserInput.IsNullOrWhiteSpace(firstName, lastName));
 }
Пример #6
0
        public bool CanAddProject(string title, string description)
        {
            //return true;

            return(ValidateUserInput.IsNullOrWhiteSpace(title, description));
        }