public async Task <IActionResult> Add(TaskAddViewModel vm) { if (ModelState.IsValid) { TaskType type = await taskTypeRepository.GetById(vm.type); User reporter = await userManager.GetUserAsync(HttpContext.User); User assignee = await userManager.FindByIdAsync(vm.assignee); Task task = new Task(); task.name = vm.name; task.description = vm.description; task.type = type; task.reporter = reporter; task.assignee = assignee; task.state = vm.state; await taskRepository.Add(task); return(RedirectToAction("Index", "Kanban")); } return(View(vm)); }
public IActionResult Add(TaskAddViewModel model) { if (_manager.CreateTask(CurrentUser(), model.Description)) { return(RedirectToAction(nameof(Index))); } else { return(View(model)); } }
private void ucTaskAdd_Load(object sender, EventArgs e) { if (DesignMode) { return; } Init(); m_viewModel = new TaskAddViewModel(); dataGridViewX1.DataSource = m_viewModel.TaskList; }
public IActionResult AddTask(TaskAddViewModel model) { if (ModelState.IsValid) { _taskService.Save(new Task { Description = model.Description, Name = model.Name, PriorityId = model.PriorityId }); return(RedirectToAction("Index")); } return(View(model)); }
public IActionResult AddTask(TaskAddViewModel model) { TempData["Active"] = "task"; if (ModelState.IsValid) { _taskService.Save(new Task { Description = model.Description, Name = model.Name, UrgencyId = model.UrgencyId, }); return(RedirectToAction("Index")); } return(View(model)); }
public TaskEditPage(TaskDTO item) { try { InitializeComponent(); if (item != null) { BindingContext = new TaskEditViewModel(item, Navigation); } else { BindingContext = new TaskAddViewModel(Navigation); } } catch (Exception e) { Debug.WriteLine(e); throw e; } }
public IActionResult Add() { var model = new TaskAddViewModel(); return(View(model)); }