예제 #1
0
        public IActionResult RegisterUser([FromBody] RegisterUserCommand command)
        {
            RegisterUserService service = new RegisterUserService(command, _repository);

            service.Run();

            return(ReturnResponse(service, new { message = "Usuário cadastrado com sucesso" }, null));
        }
예제 #2
0
        public RegisterUserService GetRegisterUserService()
        {
            if (registerUserService == null)
            {
                registerUserService = new RegisterUserService(GetProfileRepository(), GetUsersRepository());
            }

            return(registerUserService);
        }
예제 #3
0
        public ActionResult getUserList()
        {
            outputResultList <RegisterUser> userDataList = null;

            using (RegisterUserService registerUserOperation = new RegisterUserService())
            {
                userDataList = registerUserOperation.getDataList();
            }
            return(View(userDataList));
        }
예제 #4
0
        public void Dado_um_username_invalido_deve_gerar_notificacao2()
        {
            RegisterUserCommand command = new RegisterUserCommand();

            command.Username = "";
            command.Password = "******";

            RegisterUserService service = new RegisterUserService(command, new FakeUserRepository());

            service.Run();

            Assert.IsTrue(service.HasNotifications());
        }
예제 #5
0
 public HttpResponseMessage login(string email, string password)
 {
     try
     {
         RegisterUserService svc  = new RegisterUserService();
         ItemResponse <bool> resp = new ItemResponse <bool>();
         resp.Item = svc.Login(email, password);
         return(Request.CreateResponse(HttpStatusCode.OK, resp));
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
예제 #6
0
        public void Dado_um_username_invalido_deve_gerar_notificacao()
        {
            var runtime = new Runtime();

            RegisterUserCommand command = new RegisterUserCommand();

            command.Username = "";
            command.Password = "******";

            RegisterUserService service = new RegisterUserService(command, new FakeUserRepository());

            service.Run();

            runtime.AddNotifications(service.GetNotifications());

            Assert.IsTrue(runtime.HasNotifications());
        }
예제 #7
0
        public void TestMethod1()
        {
            var runtime = new Runtime();

            RegisterUserCommand command = new RegisterUserCommand();

            command.Username = "";
            command.Password = "******";

            RegisterUserService service = new RegisterUserService(command, new FakeUserRepository());

            service.Run();

            runtime.AddNotifications(service.GetNotifications());

            Assert.IsTrue(runtime.HasNotifications());
        }
예제 #8
0
        public ActionResult Index(RegisterUser userForm)
        {
            outputResult <RegisterUser> resultVal = null;

            userForm.ID             = Guid.NewGuid();
            userForm.createdDate    = DateTime.Now;
            userForm.activationCode = userForm.ID.ToString("N").ToUpper();

            using (RegisterUserService registerUserOperation = new RegisterUserService())
            {
                resultVal = registerUserOperation.addNewUser(userForm);
            }

            ViewBag.isSuccess = resultVal.isSuccess;
            ViewBag.message   = resultVal.message;

            return(View(userForm));
        }
예제 #9
0
 public HttpResponseMessage Register(RegisterUser model)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
         }
         model.ModifiedBy = "admin";
         RegisterUserService svc = new RegisterUserService();
         int id = svc.Insert(model);
         ItemResponse <int> resp = new ItemResponse <int>();
         resp.Item = id;
         return(Request.CreateResponse(HttpStatusCode.OK, resp));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message));
     }
 }
예제 #10
0
 public PaymentController(RegisterUserService registerUserService, InstitutionService institutionService)
 {
     BuckarooClient      = new SdkClient();
     _registerUser       = registerUserService;
     _institutionService = institutionService;
 }