Inheritance: INotifyPropertyChanging, INotifyPropertyChanged
Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            repository = MockRepository.GenerateMock<IRepository>();
            userTasks = MockRepository.GenerateMock<IUserTasks>();
            projectTaskType = new ProjectTaskType();
            user = new User();

            this.createWorkItemRequest = new CreateWorkItemRequest()
            {
                Name = "Bond",
                ProjectTaskTypeId = Guid.NewGuid()
            };
            repository.Stub(x => x.Get<ProjectTaskType>(createWorkItemRequest.ProjectTaskTypeId)).Return(projectTaskType);
            repository.Stub(x => x.Query<WorkItem>()).Return((new WorkItem[0]).AsQueryable());
            userTasks.Stub(x => x.GetCurrentUser()).Return(user);
        }
Ejemplo n.º 3
0
		private void detach_ProjectTaskTypes(ProjectTaskType entity)
		{
			this.SendPropertyChanging();
			entity.Task = null;
		}
Ejemplo n.º 4
0
		private void attach_ProjectTaskTypes(ProjectTaskType entity)
		{
			this.SendPropertyChanging();
			entity.Project = this;
		}