コード例 #1
0
ファイル: Program.cs プロジェクト: rodrigo1208/SW-Gestao
        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);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: rodrigo1208/SW-Gestao
 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());
         }
     }
 }