示例#1
0
        public ActionResult Create(int?ID)
        {
            List <UserViewModel> Users = UserService.GetUsers();

            ViewBag.UsersList = new SelectList(Users, "ID", "UserName");

            List <TaskStatus> TaskStatuses = TaskStatusService.GetTaskStatuses();

            ViewBag.TaskStatusesList = new SelectList(TaskStatuses, "ID", "Status");

            if (ID != null) //edit
            {
                TaskViewModel Task = TaskService.GetTaskByID(ID ?? 0);
                return(View(Task));
            }
            return(View());
        }