예제 #1
0
        private void bttNext_Click(object sender, EventArgs e)
        {
            //Check empty
            if (this.txtPass.Text.Trim() == "" || this.txtConf.Text.Trim() == "")
            {
                return;
            }

            //Check Digit
            if (this.txtPass.Text.Trim().Length < 8 || this.txtConf.Text.Trim().Length < 8)
            {
                MessageBox.Show(" Use 8 characters or more.", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop); return;
            }

            //Check Pass = Confirm
            if (this.txtPass.Text.Trim() == this.txtConf.Text.Trim())
            {
                //Send OTP to E-mail
                if (_controllors.SendOTP(_frmMain._resultLogin.empDetial))
                {
                    frmEnter_OTP _frmOTP = new frmEnter_OTP(_frmMain._resultLogin.empDetial);
                    _frmOTP.ShowDialog();
                    if (_frmOTP.DialogResult == DialogResult.OK)
                    {
                        _frmMain._resultLogin.empDetial.pass = this.txtPass.Text.Trim();
                        if (_controllors.InsertLoginFitelGroup(_frmMain._resultLogin.empDetial) == true)
                        {
                            frmSuccess _succ = new frmSuccess(1);
                            _succ.ShowDialog();

                            //Clear panel Body.
                            _frmMain.panBody.Controls.Clear();

                            //Load page search.
                            pageEnter_User _pageEnter_User = new pageEnter_User(_frmMain);
                            _frmMain.panBody.Controls.Add(_pageEnter_User);
                            _pageEnter_User.Dock = DockStyle.Fill;
                            _pageEnter_User.BringToFront();
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Passwords do not match.", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
예제 #2
0
        private void bttNext_Click(object sender, EventArgs e)
        {
            DateTime _selectConf = this.dtpSelectConf.Value;
            DateTime _startWork  = Convert.ToDateTime(_frmMain._resultLogin.empDetial.startwork);

            //Check emp startwork.
            if (_selectConf.Date == _startWork.Date)
            {
                if (_controllors.SendOTP(_frmMain._resultLogin.empDetial))
                {
                    //Confirm OTP.
                    frmEnter_OTP _frmOTP = new frmEnter_OTP(_frmMain._resultLogin.empDetial);
                    _frmOTP.ShowDialog();
                    if (_frmOTP.DialogResult == DialogResult.OK)
                    {
                        //Set New Pass
                        string newPass = _controllors.GetUniqueKey(8);
                        _frmMain._resultLogin.empDetial.pass = newPass;
                        if (_controllors.UpdatePassLoginFitelGroup(_frmMain._resultLogin.empDetial))
                        {
                            //Sent new pass
                            if (_controllors.SendNewPassword(_frmMain._resultLogin.empDetial) == true)
                            {
                                frmSuccess _succ = new frmSuccess(1);
                                _succ.ShowDialog();

                                //Clear panel Body.
                                _frmMain.panBody.Controls.Clear();

                                //Load page search.
                                pageEnter_Password _pageEnter_Password = new pageEnter_Password(_frmMain);
                                _frmMain.panBody.Controls.Add(_pageEnter_Password);
                                _pageEnter_Password.Dock = DockStyle.Fill;
                                _pageEnter_Password.BringToFront();
                            }
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("You choose the wrong start date. Please choose again.", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
예제 #3
0
        private void bttNext_Click(object sender, EventArgs e)
        {
            //Check empty
            if (this.txtPass.Text.Trim() == "" || this.txtConf.Text.Trim() == "")
            {
                return;
            }

            //Check Digit
            if (this.txtPass.Text.Trim().Length < 8 || this.txtConf.Text.Trim().Length < 8)
            {
                MessageBox.Show(" Use 8 characters or more.", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop); return;
            }

            //Check Pass = Confirm
            if (this.txtPass.Text.Trim() == this.txtConf.Text.Trim())
            {
                //Send OTP to E-mail
                if (_controllors.SendOTP(_frmMain._empDetial))
                {
                    frmEnter_OTP _frmOTP = new frmEnter_OTP(_frmMain._empDetial);
                    _frmOTP.ShowDialog();
                    if (_frmOTP.DialogResult == DialogResult.OK)
                    {
                        _frmMain._empDetial.pass = this.txtPass.Text.Trim();
                        if (_controllors.UpdatePassLoginFitelGroup(_frmMain._empDetial) == true)
                        {
                            frmSuccess _succ = new frmSuccess(1);
                            _succ.ShowDialog();

                            _frmMain.DialogResult = DialogResult.OK;
                            _frmMain.Close();
                        }
                    }
                }
            }
        }