Example #1
0
        private void Button3_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            tela_principal janelanova = new tela_principal();

            janelanova.ShowDialog();
        }
Example #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            tela_principal form2 = new tela_principal();

            form2.ShowDialog();
            this.Visible = true;
        }
Example #3
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            this.Visible = false;
            tela_principal janelanova = new tela_principal();

            janelanova.ShowDialog();
            this.Visible = true;
        }
Example #4
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 0 || textBox2.Text.Length == 0 || comboBox1.Text.Length == 0)
            {
                MessageBox.Show("Entre com os dados");
            }
            else
            {
                funcionariosBindingSource.Filter = "Func_login='******'";

                if (textBox1.Text.ToUpper() != textBox3.Text.ToUpper() ||
                    textBox2.Text.ToUpper() != textBox4.Text.ToUpper() ||
                    comboBox1.SelectedItem.ToString().ToUpper() != comboBox2.Text.ToUpper())
                {
                    MessageBox.Show("Dados incorretos");
                    return;
                }

                if (comboBox1.SelectedItem.ToString() == "Adm")
                {
                    this.Visible = false;
                    tela_principal newtelaprincipal = new tela_principal();
                    newtelaprincipal.ShowDialog();
                    this.Visible = true;
                }
                if (comboBox1.SelectedItem.ToString() == "Funcionario")
                {
                    this.Visible = false;
                    tela_principal newtelaprincipal = new tela_principal();
                    newtelaprincipal.funcionarioToolStripMenuItem.Enabled        = false; // Este item, o funcionario comum não vê
                    newtelaprincipal.backupERestauracãoToolStripMenuItem.Enabled = false; // Este item, o funcionario comum não vê
                    newtelaprincipal.fornecedorToolStripMenuItem.Enabled         = false; // Este item, o funcionario comum não vê
                    newtelaprincipal.ShowDialog();
                }
            }
        }
Example #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            //Login e senha estáticos

            if ((textBox1.Text == "adm") && (textBox2.Text == "123"))
            {
                this.Visible = false;
                tela_principal newform3 = new tela_principal();
                newform3.ShowDialog();
            }

            //Login dos Funcionarios
            if (textBox1.Text.Length == 0 && textBox2.Text.Length == 0)
            {
                MessageBox.Show("Entre com os dados");
            }
            else
            {
                funcionariosBindingSource.Filter = "Func_Login='******'";

                if (textBox1.Text.ToUpper() != textBox3.Text.ToUpper())
                {
                    MessageBox.Show("USUARIO ERRADO");
                    return;
                }
                if (textBox2.Text.ToUpper() != textBox4.Text.ToUpper())
                {
                    MessageBox.Show("SENHA ERRADA");
                    return;
                }
                this.Visible = false;
                tela_principal newmenu = new tela_principal();
                newmenu.ShowDialog();



                //{

                //    if (textBox1.Text.Length == 0 && textBox2.Text.Length == 0)
                //    {
                //        MessageBox.Show("Entre com os dados");
                //    }
                //    else
                //    {
                //        funcionariosBindingSource.Filter = "Func_Login='******'";

                //        if (textBox1.Text.ToUpper() != textBox3.Text.ToUpper() ||
                //            textBox2.Text.ToUpper() != textBox4.Text.ToUpper() ||
                //            comboBox1.SelectedItem.ToString().ToUpper() != comboBox2.Text.ToUpper())
                //        {
                //            MessageBox.Show("Dados incorretos");
                //            return;
                //        }

                //        if (comboBox1.SelectedItem.ToString() == "Adm")
                //        {
                //            this.Visible = false;
                //            tela_principal newtelaprincipal = new tela_principal();
                //            newtelaprincipal.ShowDialog();
                //            this.Visible = true;
                //        }
                //        if (comboBox1.SelectedItem.ToString() == "Funcionario")
                //        {
                //            this.Visible = false;
                //            tela_principal newtelaprincipal = new tela_principal();
                //            newtelaprincipal.funcionarioToolStripMenuItem.Enabled = false; // Este item, o funcionario comum não vê
                //            newtelaprincipal.backupERestauracãoToolStripMenuItem.Enabled = false; // Este item, o funcionario comum não vê
                //            newmenu.ShowDialog();
                //        }
                //    }
                //}
            }
        }