コード例 #1
0
ファイル: UserLogin.cs プロジェクト: ramjinrajin/Vmail
        private void lblResetPass_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtUSerEmail.Text.Trim()))
            {
                MessageBox.Show("Please type your email Id ,if you have dont remember emailId too please contact admin", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                CreateNewUser _createUser = new CreateNewUser();
                User          _user       = new User
                {
                    EmailID = txtUSerEmail.Text.ToLower()
                };

                if (!_createUser.IfExists(_user))
                {
                    LoginCredentials.LoggedEmailId = txtUSerEmail.Text.ToLower().Trim();
                    ForgotPassword frmForgotPass = new ForgotPassword(txtUSerEmail.Text.ToLower());
                    frmForgotPass.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Email Id you have entered is not registered with our application", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
コード例 #2
0
ファイル: CreateUser.cs プロジェクト: ramjinrajin/Vmail
        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);

                }



            }
        }