private void DeviceRegistrationForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     e.Cancel = true;
     if (_mp.SoftwareType == SoftwareType.TmPoint)
     {
         _mp.ShowForm(FormType.LoginForm);
     }
     else
     {
         _mp.ShowForm(FormType.LoginFormAgent);
     }
 }
예제 #2
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            IsContinue = false;

            if (_mp.SoftwareType == SoftwareType.TmPoint)
            {
                _mp.ShowForm(FormType.LoginForm);
            }
            else
            {
                _mp.ShowForm(FormType.LoginFormAgent);
            }
        }
예제 #3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(cbUserId.Text))
            {
                MessageBox.Show("Please select a User id", "Login", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (string.IsNullOrEmpty(txtPassword.Text))
            {
                MessageBox.Show("Please key in Password", "Login", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            bool isConnected = ConnectionService.CheckForInternetConnection();
            DeviceRegistrationProcessingForm lapf = new DeviceRegistrationProcessingForm(_mp);

            lapf.ShowDialog();

            if (isConnected)
            {
                bool result = _mp.AuthSvc.Authenticate(cbUserId.Text, txtPassword.Text);
                if (!result)
                {
                    MessageBox.Show("Login failed. Please try again.", "Login", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                var user = _systemUserSvc.GetByUserId(cbUserId.Text);
                if (user == null)
                {
                    MessageBox.Show("Login failed. Please try again.", "Login", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                _mp.UserProfile = user.ProfileInfo;
            }
            else
            {
                if (MessageBox.Show("There is no connection with the server.\nClick Yes to continue with Offline verification.", "No Connection", MessageBoxButtons.YesNoCancel) != System.Windows.Forms.DialogResult.Yes)
                {
                    return;
                }

                MyKadVerifcationForm f = new MyKadVerifcationForm();
                f.ShowDialog();
                if (f.ProfileInfo == null)
                {
                    MessageBox.Show("Verification Failed");
                    return;
                }
                if (!f.ProfileInfo.IsVerified)
                {
                    MessageBox.Show("Verification Failed");
                    return;
                }
                _mp.UserProfile = f.ProfileInfo;
            }

            _mp.ShowForm(FormType.MainForm);
            this.Hide();
        }
예제 #4
0
        //private void btnLogin_Click(object sender, EventArgs e)
        //{
        //    if (string.IsNullOrEmpty(cbUserId.Text))
        //    {
        //        MessageBox.Show("Please select a User id", "Login", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        //        return;
        //    }

        //    if (string.IsNullOrEmpty(txtPassword.Text))
        //    {
        //        MessageBox.Show("Please key in Password", "Login", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        //        return;
        //    }

        //    bool isConnected = ConnectionService.CheckForInternetConnection();
        //    DeviceRegistrationProcessingForm lapf = new DeviceRegistrationProcessingForm(_mp);
        //    lapf.ShowDialog();

        //    if (isConnected)
        //    {
        //        bool result = _mp.AuthSvc.Authenticate(cbUserId.Text, txtPassword.Text);
        //        if (!result)
        //        {
        //            MessageBox.Show("Login failed. Please try again.", "Login", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        //            return;
        //        }
        //    }
        //    else
        //    {
        //        if (MessageBox.Show("There is no connection with the server.\nClick Yes to continue with Offline verification.", "No Connection", MessageBoxButtons.YesNoCancel) != System.Windows.Forms.DialogResult.Yes)
        //        {
        //            return;
        //        }

        //        MyKadVerifcationForm f = new MyKadVerifcationForm();
        //        f.ShowDialog();
        //        if (f.ProfileInfo == null)
        //        {
        //            MessageBox.Show("Verification Failed");
        //            return;
        //        }
        //        if (!f.ProfileInfo.IsVerified)
        //        {
        //            MessageBox.Show("Verification Failed");
        //            return;
        //        }

        //    }

        //    _mp.ShowForm(FormType.MainForm);
        //    this.Hide();
        //}

        private void btnCreateId_Click(object sender, EventArgs e)
        {
            _mp.ShowForm(FormType.TermAndConditionForm);
            this.Hide();
        }
예제 #5
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     _mp.ShowForm(FormType.LoginForm);
 }