public ProjectForm() { InitializeComponent(); _service = new ProjectService(); _customerService = new CustomerService(); _jobRoleService = new JobRoleService(); _managerService = new ManagerService(); _planningService = new PlanningService(); defaultManager = new Manager() { Id = 1, Name = "Gerente", Phone = "11123456789", Email = "*****@*****.**", Password = "******" }; Manager foundManager = _managerService.ReadById(defaultManager.Id); if (foundManager == null) { defaultManager = _managerService.Create(defaultManager); } Activated += new EventHandler(ProjectForm_Activated); numReceita.DecimalPlaces = 2; numReceita.Maximum = 999999; numHoras.Minimum = 1; numQuantidade.Minimum = 1; }
public async Task RegisterManager_WhenIdentityUserCreationSuccessful_ShouldReturnSuccessResult() { var userEmail = "*****@*****.**"; var userName = "******"; var registerManagerRequestDto = new CreateManagerRequestDto { Name = userName, Email = userEmail }; var result = await _managerService.Create(_nationalSocietyId, registerManagerRequestDto); await _identityUserRegistrationServiceMock.Received(1).GenerateEmailVerification(userEmail); await _verificationEmailServiceMock.Received(1).SendVerificationEmail(Arg.Is <User>(u => u.EmailAddress == userEmail), Arg.Any <string>()); result.IsSuccess.ShouldBeTrue(); }
public ActionResult Post(Manager man) { if (!ModelState.IsValid) { return(BadRequest()); } man.UserId = UserId; try { var result = _service.Create(man); return(Ok(result)); } catch (Exception ex) { return(Problem(title: ex.Message)); } }
public Manager Create(Manager manager) => managerService.Create(manager);