Esempio n. 1
0
        public ActionResult CreateTaskFollow(TaskHistoryViewModel task)
        {
            try
            {
                TaskHistoryRequest taskHistoryRequest = Mapper.Map <TaskHistoryRequest>(task);
                this.TasksService.CreateTaskHistory(taskHistoryRequest);
                Task otask = this.TasksService.GetTask(task.TaskId);

                return(RedirectToAction("Details", new { id = task.TaskId }));
            }
            catch (Exception ex)
            {
                return(View("../Shared/Error"));
            }
        }
Esempio n. 2
0
        public ActionResult History(string id) /* to bypass model binding and possible exceptions on GUID */
        {
            Guid guid;
            var  outcome = Guid.TryParse(id, out guid);

            if (!outcome)
            {
                throw new InvalidGuidException("Could not find specified task");
            }

            var history = new HistoryService(TaskZeroApplication.EventStore,
                                             TaskZeroApplication.AggregateRepository);
            var model = new TaskHistoryViewModel
            {
                History = history.GetTaskHistory(guid, DateTime.Now)
            };

            return(View(model));
        }
        private async void ResolveHistory()
        {
            if (_isHistoryBeingResolved)
            {
                return;
            }
            IsHistoryBeingResolved = true;
            var taskHistory = await _repositoryService.GetEntityHistory(Task);

            IsHistoryBeingResolved = false;
            if (taskHistory == null)
            {
                MessageBox.Show(IocLocator.ResourceManager.GetString("NoTaskHistoryInRepository"));
                return;
            }
            CreationDate = taskHistory.CreationDate.ToString("g");
            var taskHistoryViewModel = new TaskHistoryViewModel(taskHistory, _taskStateQueryService);
            var taskHistoryWindow    = new TaskHistoryWindow(taskHistoryViewModel)
            {
                Owner = Application.Current.MainWindow
            };

            taskHistoryWindow.Show();
        }
 public TaskHistoryWindow(TaskHistoryViewModel viewModel)
 {
     DataContext = viewModel;
     InitializeComponent();
 }