IEnumerator SignUp(SignUpForm form)
    {
        string postData = JsonUtility.ToJson(form);

        byte[] sendData = Encoding.UTF8.GetBytes(postData);

        using (UnityWebRequest www = UnityWebRequest.Put("https://tictactoekhj.herokuapp.com/users/add", postData))
        {
            www.method = "POST";
            www.SetRequestHeader("Content-Type", "application/json");

            yield return(www.Send());

            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log(www.error);
            }
            else
            {
                Debug.Log(www.downloadHandler.text);

                // 회원가입 성공하면 Signup 패널 닫기
                string result = www.downloadHandler.text;

                if (result.Equals("success"))
                {
                    signupPanel.GetComponent <RectTransform>().anchoredPosition
                        = new Vector2(560, 0);
                }
            }
        }
    }
Example #2
0
        private async void SignUpButton_Click(object sender, EventArgs e)
        {
            if (!FormValidator.ValidateAll())
            {
                MessageBox.Show("Invalid data", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {
                UseWaitCursor = true;

                SignUpForm signUpForm = new SignUpForm(LoginInput.Text, PasswordInput.Text);
                Program.DI.Resolve <Session>().Update(await Program.DI.Resolve <AuthController>().SignUp(signUpForm));

                UseWaitCursor = false;
                MessageBox.Show("Registration successful", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);

                ResetCredentials();
                EnterSystem();
            }
            catch (ResponseException ex)
            {
                UseWaitCursor = false;
                MessageBox.Show(ex.message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public virtual ActionResult Post(SignUpForm model)
        {
            if (model == null)
            {
                return(HttpNotFound());
            }

            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            // execute command
            var command = Mapper.Map <SendCreatePasswordMessageCommand>(model);

            command.SendFromUrl = Url.Action(MVC.Identity.SignOn.Get());
            _services.CommandHandler.Handle(command);

            // flash feedback message
            SetFeedbackMessage(string.Format(SuccessMessageFormat, model.EmailAddress));

            // redirect to confirm email
            return(RedirectToRoute(new
            {
                area = MVC.Identity.Name,
                controller = MVC.Identity.ConfirmEmail.Name,
                action = MVC.Identity.ConfirmEmail.ActionNames.Get,
                token = command.ConfirmationToken,
            }));
        }
Example #4
0
    // 회원가입 확인버튼
    public void OnClickConfirmButton()
    {
        string password        = passwordIF.text;
        string confirmPassword = confirmPasswordIF.text;
        string username        = usernameIF.text;
        string nickname        = nicknameIF.text;

        if (string.IsNullOrEmpty(password) || string.IsNullOrEmpty(confirmPassword) ||
            string.IsNullOrEmpty(username) || string.IsNullOrEmpty(nickname))
        {
            return;
        }

        if (password.Equals(confirmPassword))
        {
            // TODO: 서버에 회원가입 정보 전송

            SignUpForm signupForm = new SignUpForm();
            signupForm.username = username;
            signupForm.password = password;
            signupForm.nickname = nickname;


            StartCoroutine(SignUp(signupForm));
        }
    }
Example #5
0
 public RegisterPageViewModel(INavigationService navigationService, IPageDialogService pageDialog, IAPIManager apiManager) : base(navigationService)
 {
     Form            = new SignUpForm();
     _apiManager     = apiManager;
     _pageDialog     = pageDialog;
     RegisterCommand = new DelegateCommand(ExecuteRegister);
 }
Example #6
0
        private void label3_Click(object sender, EventArgs e)
        {
            this.Hide();
            SignUpForm signUpForm = new SignUpForm();

            signUpForm.Show();
        }
        public async Task <Session> SignUp(SignUpForm signUpForm)
        {
            IQuery          signUpQuery = Program.DI.Resolve <SignUpQueryFactory>().SignUp(signUpForm);
            IServerResponse response    = await Program.DI.Resolve <IServerCommunicator>().SendQuery(signUpQuery);

            return(Program.DI.Resolve <IResponseParser>().Parse <Session>(response));
        }
 public static void OnFailToEstabilishConnection(SignUpForm signUpForm)
 {
     signUpForm.TickAction = new Action(() =>
     {
         signUpForm.SetEnableInterfaceElements(true);
     });
 }
Example #9
0
 public IActionResult SignUp(SignUpForm form)
 {
     return(Form(
                form,
                () => this.RedirectToAction <EmployeeController>(c => c.List()),
                () => View(form)));
 }
Example #10
0
 public static SignUpForm SignUpForm()
 {
     if (signUpForm == null)
     {
         signUpForm = new SignUpForm();
     }
     return(signUpForm);
 }
        public ActionResult SignUp(SignUpForm form)
        {
            var user = Core.Domain.User.CreateNewUser(form.EmailAddress, form.Password);

            _users.Save(user);

            return new LogOnResult(user.EmailAddress);
        }
Example #12
0
        public async Task <SessionDto> SignUp(SignUpForm signUpForm)
        {
            await Server.SendPost <SignUpForm, object>(
                ServerHolder.SERVER_URL + SIGN_UP_ENDPOINT,
                signUpForm
                );

            return(await LogIn(new LogInForm(signUpForm)));
        }
Example #13
0
        // Креирање на нов корисник (играч)
        private void btnSignUp_Click(object sender, EventArgs e)
        {
            SignUpForm signUp = new SignUpForm(); // Нова инстанца на SignUp формата

            this.Hide();
            signUp.ShowDialog();
            signUp.Dispose();
            this.Show();
        }
Example #14
0
        private void button_SignUp_Click(object sender, EventArgs e)
        {
            SignUpForm signup = new SignUpForm(ctrl);

            signup.parentForm = this;
            this.Owner        = signup;
            this.Hide();
            signup.Show();
        }
Example #15
0
        public void UnitTest16(SignUpForm input)
        {
            _userLayer.Setup(x => x.RegisterUser(It.IsAny <SignUpForm>())).Returns(true);
            var ActualResult = _userBiz.RegistorUser(input);

            _userLayer.Verify(x => x.RegisterUser(input), Times.Once);
            Assert.NotNull(ActualResult);
            Assert.True(ActualResult.StatusCode == 200);
            Assert.Null(ActualResult.ErrorList);
        }
Example #16
0
        public void UnitTest14(SignUpForm input)
        {
            _userLayer.Setup(x => x.isExistPhoneNumber(It.IsAny <string>())).Returns(false);
            _userLayer.Setup(x => x.RegisterUser(It.IsAny <SignUpForm>())).Throws(new Exception());

            var ActualResult = Record.Exception(() => _userBiz.RegistorUser(input));

            _userLayer.Verify(x => x.RegisterUser(input), Times.Once);
            Assert.Null(ActualResult);
        }
 public IActionResult SignUp(SignUpForm applicant)
 {
     if (ModelState.IsValid)
     {
         return(View("GetStarted", applicant));
     }
     else
     {
         return(View());
     }
 }
Example #18
0
        public void UnitTest10(SignUpForm input)
        {
            _userLayer.Setup(x => x.isExistPhoneNumber(It.IsAny <string>())).Returns(false);
            _userLayer.Setup(x => x.RegisterUser(It.IsAny <SignUpForm>())).Returns(true);

            var ActualResult = _userBiz.RegistorUser(input);

            Assert.NotNull(ActualResult);
            Assert.True(ActualResult.StatusCode == 200);
            Assert.Null(ActualResult.ErrorList);
        }
Example #19
0
        private void signUpButton_Click(object sender, EventArgs e)
        {
            signForm = new SignUpForm(signPanel.Controls)
            {
                Dock     = DockStyle.Fill,
                TopLevel = false,
                TopMost  = true
            };

            signPanel.Controls.Add(signForm);
            signForm.Show();
        }
Example #20
0
 public Recipient CreateRecipient(SignUpForm form)
 {
     return(new Recipient()
     {
         AccountNumber = form.AccountNumber,
         BankId = form.BankId,
         Mobile = form.Mobile,
         Email = form.Email,
         Name = form.FullName(),
         RecordStatus = 1
     });
 }
Example #21
0
 public ActionResult SignUp(SignUpForm signUpForm)
 {
     if (!String.IsNullOrWhiteSpace(signUpForm.Name) &&
         !String.IsNullOrWhiteSpace(signUpForm.Surname) &&
         !String.IsNullOrWhiteSpace(signUpForm.Email) &&
         !String.IsNullOrWhiteSpace(signUpForm.Password) &&
         !String.IsNullOrWhiteSpace(signUpForm.PasswordConfirmation) &&
         !String.IsNullOrWhiteSpace(signUpForm.Phone) &&
         signUpForm.Birthday != null &&
         !String.IsNullOrWhiteSpace(signUpForm.CityId.ToString()) &&
         !String.IsNullOrWhiteSpace(signUpForm.AccountTypeId.ToString()))
     {
         if (db.Users.FirstOrDefault(u => u.Email == signUpForm.Email) == null)
         {
             if (signUpForm.Password == signUpForm.PasswordConfirmation)
             {
                 User newuser = new User
                 {
                     Fullname       = signUpForm.Name + " " + signUpForm.Surname,
                     Email          = signUpForm.Email,
                     Birthday       = signUpForm.Birthday,
                     Password       = Crypto.HashPassword(signUpForm.Password),
                     Phone          = signUpForm.Phone,
                     AccountType    = signUpForm.AccountTypeId,
                     CityId         = signUpForm.CityId,
                     ProfileImage   = "/public/images/profile_placeholder.png",
                     OverallRating  = 0,
                     RegisteredDate = DateTime.Now
                 };
                 db.Users.Add(newuser);
                 db.SaveChanges();
                 Session["SignedUpSuccess"] = true;
             }
             else
             {
                 Session["SignedUpError"] = true;
                 Session["SignUpMsg"]     = "Password and Password Confirmation are not matching.";
             }
         }
         else
         {
             Session["SignedUpError"] = true;
             Session["SignUpMsg"]     = "User with this email already exists.";
         }
     }
     else
     {
         Session["SignedUpError"] = true;
         Session["SignUpMsg"]     = "Please, fill all the inputs.";
     }
     return(RedirectToAction("index"));
 }
Example #22
0
        public void UnitTest4(SignUpForm input)
        {
            startup = new Startup("PorwalGeneralStore_RegisterUser_DB", false);
            _porwalGeneralStoreContext = startup._inMemoryContext;
            _userLayer = new UserLayer(_porwalGeneralStoreContext);
            var ActualResult   = _userLayer.RegisterUser(input);
            var ExpectedResult = _porwalGeneralStoreContext
                                 .CustomerInfo
                                 .Any(x => x.Phone.Equals(input.MobileNumber, StringComparison.OrdinalIgnoreCase));

            Assert.True(ActualResult);
            Assert.True(ExpectedResult);
        }
Example #23
0
        public void UnitTest11(SignUpForm input)
        {
            _userLayer.Setup(x => x.isExistPhoneNumber(It.IsAny <string>())).Returns(false);
            _userLayer.Setup(x => x.RegisterUser(It.IsAny <SignUpForm>())).Returns(true);

            var ActualResult = _userBiz.RegistorUser(input);

            _userLayer.Verify(x => x.RegisterUser(input), Times.Once);
            Assert.NotNull(ActualResult);
            Assert.True(ActualResult.StatusCode == 200);
            Assert.Equal("User is Successfully Registered.", ActualResult.Message);
            Assert.Null(ActualResult.ErrorList);
        }
Example #24
0
        public async Task <ActionResult> SignUp(SignUpForm form)
        {
            try
            {
                await _service.SignUpUser(form);

                return(Ok());
            }
            catch (Exception e)
            {
                return(StatusCode(215, e.ToString()));
            }
        }
        private static void Main(string[] args)
        {
            // The client code can parameterize an invoker with any commands.
            var user         = "******";
            var input        = "Some input";
            var inputHandler = new InputHandler();

            var signUpForm = new SignUpForm();

            signUpForm.SetOnStart(new ValidateInput(input));
            signUpForm.SetOnFinish(new SubmitInput(inputHandler, user, input));

            signUpForm.Render();
        }
Example #26
0
        public void UnitTest13(SignUpForm input)
        {
            _userLayer.Setup(x => x.isExistPhoneNumber(It.IsAny <string>())).Returns(false);
            _userLayer.Setup(x => x.RegisterUser(It.IsAny <SignUpForm>())).Throws(new Exception());

            var ActualResult = _userBiz.RegistorUser(input);

            _userLayer.Verify(x => x.RegisterUser(input), Times.Once);
            Assert.NotNull(ActualResult);
            Assert.True(ActualResult.StatusCode == 400);
            Assert.True(string.IsNullOrWhiteSpace(ActualResult.Message));
            Assert.NotNull(ActualResult.ErrorList);
            Assert.True(ActualResult.ErrorList.Count > 0);
        }
        public SignUpPage()
        {
            InitializeComponent();
            _signUpForm = new SignUpForm {
                Account = Account, User = User
            };

            DataContext = this;
            if (LicenseManager.UsageMode != LicenseUsageMode.Designtime)
            {
                Width  = double.NaN;
                Height = double.NaN;
            }
        }
        public bool RegisterUser(SignUpForm signUpForm)
        {
            CustomerInfo customerInfo = new CustomerInfo()
            {
                CustomerName = signUpForm.UserName,
                Phone        = signUpForm.MobileNumber,
                City         = signUpForm.City,
                FirstName    = signUpForm.FirstName,
                LastName     = signUpForm.LastName,
                Password     = signUpForm.Password
            };

            context.Entry <CustomerInfo>(customerInfo).State = EntityState.Added;
            return(context.SaveChanges() > 0);
        }
Example #29
0
        public async Task <IActionResult> SignUp(SignUpForm signUpForm)
        {
            if (User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Index", "Profile"));
            }

            if (!bool.Parse(_settingsKeeper.GetSetting("EnableRegistration").Value))
            {
                return(RedirectToAction("SignIn"));
            }

            if (!ModelState.IsValid)
            {
                TempData["Error"] = true;

                return(RedirectToAction("SignUp"));
            }

            var enableEmail = bool.Parse(_settingsKeeper.GetSetting("EnableEmailRecovery").Value);

            var user = new IdentityUser <int>
            {
                UserName       = signUpForm.Username,
                Email          = signUpForm.Email,
                EmailConfirmed = !enableEmail
            };
            var result = await _userManager.CreateAsync(user, signUpForm.Password);

            if (result.Succeeded)
            {
                if (enableEmail)
                {
                    var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);

                    var callbackUrl = $"{_settingsKeeper.GetSetting("SiteUrl").Value}{Url.Action("Confirm", new {userId = user.Id, code})}";
                    await _emailSender.SendEmailAsync(user.Email, "Confirm your email", $"Please confirm your account by clicking on the following link. Link: {callbackUrl}");
                }

                TempData["Result"] = enableEmail ? "EmailRegSent" : "RegComplete";

                return(RedirectToAction("SignIn"));
            }

            TempData["Error"] = true;

            return(RedirectToAction("SignUp"));
        }
Example #30
0
        public void SignUp(SignUpForm signUpForm, Action <string> tokenConsumer)
        {
            var request = new RestRequest("authentication/signup", Method.POST);

            request.AddJsonBody(signUpForm);

            void FailureHandler(IRestResponse response)
            {
            }

            void ErrorHandler()
            {
                Application.Current.Dispatcher?.Invoke(() => { MessageBox.Show("Can't connect to Mathenger server"); });
            }

            _sender.Send(request, tokenConsumer, ErrorHandler, FailureHandler);
        }
        public static void SignUp(SignupViewModel svm)
        {
            if (AuthController.SignUp(svm))
            {
                LogIn(new LoginViewModel
                {
                    Email    = svm.Email,
                    Password = svm.Password
                });

                SignUpForm.Close();
            }
            else
            {
                MessageBox.Show("Could not register you with these credentials.",
                                "Authentication error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #32
0
 private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     SignUpForm CreateAccount = new SignUpForm();
     CreateAccount.Show();
 }
 public ActionResult SignUp(SignUpForm form)
 {
     return Handle(form).Return(() => Redirect<ShipyardController>(x => x.Index()));
 }