Beispiel #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            FormEntrada entrada = new FormEntrada();
            Login login = new Login();
            do
            {
                entrada.ShowDialog();
                if (entrada.DialogResult == DialogResult.OK)
                {
                    if (login.ShowDialog() == DialogResult.OK)
                    {
                        Application.Run(new SistemaControle());
                    }
                    if (login.DialogResult == DialogResult.No)
                    {
                        login.Close();
                    }
                    if (login.DialogResult == DialogResult.Retry)
                        MessageBox.Show("Login ou senha incoreta");
                }
                if (entrada.DialogResult == DialogResult.Yes)
                {
                    if (login.ShowDialog() == DialogResult.OK)
                    {
                        Application.Run(new Caixa());
                    }
                    if (login.DialogResult == DialogResult.No)
                    {
                        login.Close();
                    }
                    if (login.DialogResult == DialogResult.Retry)
                        MessageBox.Show("Login ou senha incoreta");
                }

                if (entrada.DialogResult == DialogResult.Abort)
                {
                    if (login.ShowDialog() == DialogResult.OK)
                    {
                        Application.Run(new PesquisarProduto());
                    }
                    if (login.DialogResult == DialogResult.No)
                    {
                        login.Close();
                    }
                    if (login.DialogResult == DialogResult.Retry)
                        MessageBox.Show("Login ou senha incoreta");
                }
            } while (entrada.DialogResult != DialogResult.No);
        }
Beispiel #2
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     FormEntrada entrada = new FormEntrada();
     Login login = new Login();
     Caixa caixa = new Caixa();
     if(entrada.ShowDialog() == DialogResult.OK)
     {
         if (login.ShowDialog() == DialogResult.OK)
         {
             Application.Run(new SistemaControle());
         }
         else
             MessageBox.Show("Login ou senha incoreta");
     }
     else
     {
         if(login.ShowDialog() == DialogResult.OK)
         {
             Application.Run(new Caixa());
         }
     }
 }