Beispiel #1
0
 public ActionResult CreateTask(AnalyzeTaskView task)
 {
     if (ModelState.IsValid)
     {
         ToDoCreateTask toDoCreateTask = new ToDoCreateTask();
         toDoCreateTask.Record(Request, ref task);
         return(RedirectToAction("ToDo"));
     }
     else
     {
         PriorityItems priorityItems     = new PriorityItems();
         CategoryItems categoryItems     = new CategoryItems();
         SelectList    listPriorityItems = new SelectList(priorityItems.Priorities(), "Id", "Name");
         SelectList    listCategoryItems = new SelectList(categoryItems.Categories(), "Id", "Name");
         return(View(new AccountTask
         {
             Name = task.Name,
             Objective = task.Objective,
             EndDate = task.EndDate,
             StartDate = task.StartDate,
             selectCategoryItems = listCategoryItems,
             selectPriorityItems = listPriorityItems
         }));
     }
 }
Beispiel #2
0
        public ActionResult TaskCategory()
        {
            CategoryItems categoryItems = new CategoryItems();
            SelectList    listItems     = new SelectList(categoryItems.Categories(), "Id", "Name");

            return(PartialView("_TasksCategory", new AccountTask {
                selectCategoryItems = listItems
            }));
        }