public async Task <IActionResult> DeleteProjectManagementTaskToEmployee([FromBody] ProjectManagementTaskToEmployeeView view)
        {
            ProjectManagementTaskToEmployeeModule invMod = new ProjectManagementTaskToEmployeeModule();
            ProjectManagementTaskToEmployee       projectManagementTaskToEmployee = await invMod.ProjectManagementTaskToEmployee.Query().MapToEntity(view);

            invMod.ProjectManagementTaskToEmployee.DeleteProjectManagementTaskToEmployee(projectManagementTaskToEmployee).Apply();

            return(Ok(view));
        }
        public async Task TestAddUpdatDelete()
        {
            ProjectManagementTaskToEmployeeModule ProjectManagementTaskToEmployeeMod = new ProjectManagementTaskToEmployeeModule();
            Employee employee = await ProjectManagementTaskToEmployeeMod.Employee.Query().GetEntityById(3);

            AddressBook addressBook = await ProjectManagementTaskToEmployeeMod.AddressBook.Query().GetEntityById(employee.AddressId);

            ProjectManagementTask task = await ProjectManagementTaskToEmployeeMod.Task.Query().GetEntityById(5);

            ProjectManagementMilestone milestone = await ProjectManagementTaskToEmployeeMod.Milestone.Query().GetEntityById(task.MileStoneId);

            ProjectManagementProject project = await ProjectManagementTaskToEmployeeMod.Project.Query().GetEntityById(milestone.ProjectId);

            ProjectManagementTaskToEmployeeView view = new ProjectManagementTaskToEmployeeView()
            {
                TaskId          = task.TaskId,
                EmployeeId      = employee.EmployeeId,
                EmployeeName    = addressBook.Name,
                TaskName        = task.TaskName,
                TaskDescription = task.Description,
                MilestoneName   = milestone.MilestoneName,
                ProjectName     = project.ProjectName
            };
            NextNumber nnNextNumber = await ProjectManagementTaskToEmployeeMod.ProjectManagementTaskToEmployee.Query().GetNextNumber();

            view.TaskToEmployeeNumber = nnNextNumber.NextNumberValue;

            ProjectManagementTaskToEmployee projectManagementTaskToEmployee = await ProjectManagementTaskToEmployeeMod.ProjectManagementTaskToEmployee.Query().MapToEntity(view);

            ProjectManagementTaskToEmployeeMod.ProjectManagementTaskToEmployee.AddProjectManagementTaskToEmployee(projectManagementTaskToEmployee).Apply();

            ProjectManagementTaskToEmployee newProjectManagementTaskToEmployee = await ProjectManagementTaskToEmployeeMod.ProjectManagementTaskToEmployee.Query().GetEntityByNumber(view.TaskToEmployeeNumber);

            Assert.NotNull(newProjectManagementTaskToEmployee);

            newProjectManagementTaskToEmployee.EmployeeId = 6;

            ProjectManagementTaskToEmployeeMod.ProjectManagementTaskToEmployee.UpdateProjectManagementTaskToEmployee(newProjectManagementTaskToEmployee).Apply();

            ProjectManagementTaskToEmployeeView updateView = await ProjectManagementTaskToEmployeeMod.ProjectManagementTaskToEmployee.Query().GetViewById(newProjectManagementTaskToEmployee.TaskToEmployeeId);

            if (updateView.EmployeeId != 6)
            {
                Assert.True(false);
            }

            ProjectManagementTaskToEmployeeMod.ProjectManagementTaskToEmployee.DeleteProjectManagementTaskToEmployee(newProjectManagementTaskToEmployee).Apply();
            ProjectManagementTaskToEmployee lookupProjectManagementTaskToEmployee = await ProjectManagementTaskToEmployeeMod.ProjectManagementTaskToEmployee.Query().GetEntityById(view.TaskToEmployeeId);

            Assert.Null(lookupProjectManagementTaskToEmployee);
        }
        public async Task <IActionResult> AddProjectManagementTaskToEmployee([FromBody] ProjectManagementTaskToEmployeeView view)
        {
            ProjectManagementTaskToEmployeeModule invMod = new ProjectManagementTaskToEmployeeModule();

            NextNumber nnProjectManagementTaskToEmployee = await invMod.ProjectManagementTaskToEmployee.Query().GetNextNumber();

            view.TaskToEmployeeNumber = nnProjectManagementTaskToEmployee.NextNumberValue;

            ProjectManagementTaskToEmployee projectManagementTaskToEmployee = await invMod.ProjectManagementTaskToEmployee.Query().MapToEntity(view);

            invMod.ProjectManagementTaskToEmployee.AddProjectManagementTaskToEmployee(projectManagementTaskToEmployee).Apply();

            ProjectManagementTaskToEmployeeView newView = await invMod.ProjectManagementTaskToEmployee.Query().GetViewByNumber(view.TaskToEmployeeNumber);


            return(Ok(newView));
        }
 public IFluentProjectManagementTaskToEmployee DeleteProjectManagementTaskToEmployee(ProjectManagementTaskToEmployee deleteObject)
 {
     unitOfWork.projectManagementTaskToEmployeeRepository.DeleteObject(deleteObject);
     this.processStatus = CreateProcessStatus.Delete;
     return(this as IFluentProjectManagementTaskToEmployee);
 }
 public IFluentProjectManagementTaskToEmployee AddProjectManagementTaskToEmployee(ProjectManagementTaskToEmployee newObject)
 {
     unitOfWork.projectManagementTaskToEmployeeRepository.AddObject(newObject);
     this.processStatus = CreateProcessStatus.Insert;
     return(this as IFluentProjectManagementTaskToEmployee);
 }