public ActionResult Create(CreateProjectTaskType createProjectTaskType)
 {
     if (!ModelState.IsValid)
      {
      	return Create();
      }
      projectTaskTypeTasks.Create(createProjectTaskType);
      	return RedirectToAction("Index");
 }
Пример #2
0
        public void Create(CreateProjectTaskType createProjectTaskType)
        {
            var project = repository.Get<Project>(createProjectTaskType.ProjectId);
            var task = repository.Get<Task>(createProjectTaskType.TaskId);
            var taskType = repository.Get<TaskType>(createProjectTaskType.TaskTypeId);

            ProjectTaskType projectTaskType = new ProjectTaskType()
                                              	{
                                              		Id = Guid.NewGuid(),
                                              		Name = createProjectTaskType.Name,
                                              		Project = project,
                                              		Task = task,
                                              		Type = taskType
                                              	};

            repository.Insert(projectTaskType);
        }