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