public void AddWorkTask(WorkTask workTask) { workTask.DateCreate = DateTime.Now; workTask.Id = Guid.NewGuid(); if (workTask.Files != null && workTask.Files.Count > 0) { foreach (var item in workTask.Files) { item.Id = Guid.NewGuid(); } } if (workTask.Comments != null && workTask.Comments.Count > 0) { foreach (var item in workTask.Comments) { item.Id = Guid.NewGuid(); item.DateCreate = DateTime.Now; } } WorkTasks.Add(workTask); using (var db = new DB()) { db.InsertWorkTask(workTask); } }
public void InsertWorkTask(WorkTask workTask) { WorkTaskTable workTaskDB = new WorkTaskTable(connection); if (workTask.Comments != null) { InsertCommits(workTask.Comments.ToArray()); } if (workTask.Files != null) { InsertAdditionFiles(workTask.Files.ToArray()); } workTaskDB.Insert(workTask); }
public NewTaskWindows() { NormalizeWindiwSetting.Normalize(typeof(NewTaskWindows)); InitializeComponent(); WorkTask = new WorkTask() { Name = "Новая задача", Text = "Описание", Files = new ObservableCollection <AdditionFile>(), Comments = new ObservableCollection <Comment>() }; workTaskViewModel = new WorkTaskViewModel(WorkTask); DataContext = workTaskViewModel; }
public WorkTaskViewModel(WorkTask workTask) { this.workTask = workTask; }
public RiminderController(WorkTask workTask, Reminder reminder) { this.workTask = workTask; this.reminder = reminder; }
public void AddComment(WorkTask workTask, Comment comment) { InsertCommits(comment); UpdateWorkTask(workTask); }
public void UpdateWorkTask(WorkTask workTask) { WorkTaskTable workTaskDB = new WorkTaskTable(connection); workTaskDB.Update(workTask); }