private void DoLogin()
        {
            Login dlg = new Login();

            dlg.ShowDialog(this);
            if (dlg.HasData)
            {
                Cursor = Cursors.WaitCursor;
                BaseMain.SetStatus("Verifying user...");
                BusinessPrincipal.Login(dlg.Username, dlg.Password);
                BaseMain.SetStatus("");
                Cursor = Cursors.Default;

                if (Thread.CurrentPrincipal.Identity.IsAuthenticated)
                {
                    pnlUser.Text = Thread.CurrentPrincipal.Identity.Name;
                    BuildMenus();
                }
                else
                {
                    DoLogout();
                    MessageBox.Show("The username and password were not valid",
                                    "Incorrect Password", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                }
            }
            else
            {
                DoLogout();
            }
        }
 private void InitializeForm()
 {
     mMain = this;
 }
Ejemplo n.º 3
0
 public static void SetStatus(string StatusMessage)
 {
     BaseMain.SetStatus(StatusMessage);
 }