示例#1
0
        private static void Signout()
        {
            // this.Close();
            List <Form> forms = new List <Form>();

            // All opened myForm instances
            foreach (Form f in Application.OpenForms)
            {
                // if (f.Name != "DeleteUser")
                forms.Add(f);
            }


            // Now let's close opened myForm instances
            foreach (Form f in forms)
            {
                f.Hide();
            }

            //UserLogin userloginfrm = new UserLogin(true);
            //userloginfrm.Show();
            ApiAuthenticate auth = new ApiAuthenticate();

            auth.Show();
        }
示例#2
0
        private void ConfirmToCreate()
        {
            User _user = new User();
            _user.Name = txtname.Text;
            _user.Password = Password;
            _user.Gender = cmbGender.Text;
            _user.DOB = DateTime.Now.ToString("yyyy-MM-dd");
            _user.ConPassword = ConfrmPassWord;
            _user.EmailID = txtEmail.Text;
            _user.SecurityAns = txtSecurityAns.Text;
            _user.SecutityQues = CmbSecQues.Text;


            CreateNewUser _createUser = new CreateNewUser();


            string IsEmptyUSer = IsEmpty.CheckIfEmpty_User(_user);

            if (IsEmptyUSer != null)
            {
                MessageBox.Show(IsEmptyUSer, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            else
            {
                if (IsEqual.CompareText(_user.Password, _user.ConPassword))
                {
                    if (IsValidEmail(txtEmail.Text))
                    {



                        if (txtSecurityAns.Text != "")
                        {

                            if (_createUser.IfExists(_user))
                            {
                                if (_createUser.CreateUSer(_user))
                                {
                                    MessageBox.Show("New user created sucessfully", "Sucess", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                                    //UserLogin ul = new UserLogin(true);
                                    ApiAuthenticate ul = new ApiAuthenticate();
                                    List<Form> forms = new List<Form>();
                                    // All opened myForm instances
                                    foreach (Form f in Application.OpenForms)
                                    {

                                        forms.Add(f);
                                    }
                                    // Now let's close opened myForm instances
                                    foreach (Form f in forms)
                                    {
                                        f.Hide();
                                    }
                                    ul.ShowDialog();



                                }
                                else
                                {
                                    MessageBox.Show("Unable to create new user", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                }


                            }
                            else
                            {
                                MessageBox.Show("EmailID already exists!!!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            }
                        }
                        else
                        {
                            MessageBox.Show("Please choose a secuity answer cannot be empty", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                    else
                    {

                        MessageBox.Show("Email Id seems to be invalid", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }


                }
                else
                {
                    if (SpeechModule.GetStatus())
                    {

                        if (cmbGender.Text != "")
                        {

                            synth.SetOutputToDefaultAudioDevice();
                            synth.Speak("Password does not match");
                            synth.Speak("Please say the password again");
                            txtPassword.Text = "";
                            txtConfirmPassword.Text = "";
                            txtPassword.Focus();

                        }
                    }
                    else


                        MessageBox.Show("Password does not match!!!", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

                }



            }
        }