private void button1_Click(object sender, EventArgs e) { TaskHistory task = new TaskHistory("Test", 0); task.Forward(new ForwardHistory(0)); task.Forward(new ForwardHistory(1)); AttachmentHistory attachment = new AttachmentHistory("C:\\Users\\shaks"); task.addAttachment(attachment); attachment = new AttachmentHistory("C:\\Users\\shakshak"); task.addAttachment(attachment); DescriptionHistory description = new DescriptionHistory("Bla bla bla"); task.editDescription(description); description = new DescriptionHistory("Bla bla blaaaaaaaaaaaaaaaaaaaaaa"); task.editDescription(description); task.addComment(new CommentHistory("comment")); task.addComment(new CommentHistory("commmmmmmmmmment")); TaskHistory.readTasks(); task.taskId = TaskHistory.tasks.Count; TaskHistory.tasks.Add(task); TaskHistory.writeTasks(); }
private void Add_Click(object sender, EventArgs e) { string CommentText = Description.Text; if (!CommentText.Equals("")) { TaskHistory.readTasks(); foreach (TaskHistory taskHistory in TaskHistory.tasks) { if (taskHistory.taskId.ToString() == id) { CommentHistory commentHistory = new CommentHistory(CommentText); taskHistory.addComment(commentHistory); break; } } TaskHistory.writeTasks(); } else { MessageBox.Show("Please Add comment"); } }