private void ButtonVoltar_Click(object sender, EventArgs e)
        {
            Register_Food here = new Register_Food();
            CreateFood    food = new CreateFood();

            this.Hide();
            this.Closed += (s, args) => here.Close();
            food.Show();
        }
Exemple #2
0
        private void ButtonRefeicao_Click(object sender, EventArgs e)
        {
            CreateFood food = new CreateFood();
            Dashboard  here = new Dashboard();

            this.Hide();
            this.Closed += (s, args) => here.Close();
            food.Show();
        }
Exemple #3
0
        private void ButtonVoltar_Click_1(object sender, EventArgs e)
        {
            CreateFood here = new CreateFood();
            Dashboard  dash = new Dashboard();

            this.Hide();
            this.Closed += (s, args) => here.Close();
            dash.Show();
        }
        private void ButtonCadastrar_Click(object sender, EventArgs e)
        {
            DataBase.Database data = new DataBase.Database();
            bool queryDB           = data.CommandSQL("insert into alimento(nome_alim,calorias_alim) values('" + InputAlimento.Text + "','" + InputCaloria.Text + "');");

            if (queryDB)
            {
                Register_Food here = new Register_Food();
                CreateFood    food = new CreateFood();
                this.Hide();
                this.Closed += (s, args) => here.Close();
                food.Show();
                MessageBox.Show("Alteração Efetuada!", "Muito Obrigado!"
                                , MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else
            {
                MessageBox.Show("Alteração Não Efetuada!", "ERRO!"
                                , MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }