Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
        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;
 }
Beispiel #6
0
 public void AddComment(WorkTask workTask, Comment comment)
 {
     InsertCommits(comment);
     UpdateWorkTask(workTask);
 }
Beispiel #7
0
        public void UpdateWorkTask(WorkTask workTask)
        {
            WorkTaskTable workTaskDB = new WorkTaskTable(connection);

            workTaskDB.Update(workTask);
        }