using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AP8___BDE_CANIAUX_Romain
{
    public partial class Ajouter_produit : Form
    {
        public Ajouter_produit()
        {
            InitializeComponent();
        }

        private void btn_valider_Click(object sender, EventArgs e)
        {
            Stock.sweat = (int)nud_sweat.Value;
            MessageBox.Show("Vous venez d'ajouter " + nud_sweat.Value +"  Sweat , " + nud_mug.Value + "  Mugs , " + nud_polo.Value + "  Polos , " + nud_gourde.Value + "  Gourdes au stock ");
            Stock.mug = (int)nud_mug.Value;
            Stock.polo = (int)nud_polo.Value;
            Stock.gourde = (int)nud_gourde.Value;
        }

        private void Ajouter_produit_Load(object sender, EventArgs e)
        {
            nud_sweat.Value = Stock.sweat;
            nud_mug.Value = Stock.mug;
            nud_polo.Value = Stock.polo;
            nud_gourde.Value = Stock.gourde;

            if(Stock.sweat > 0)
            {
                nud_sweat.Enabled = false;
            }
            if (Stock.mug > 0)
            {
                nud_mug.Enabled = false;
            }
            if (Stock.polo > 0)
            {
                nud_polo.Enabled = false;
            }
            if (Stock.gourde > 0)
            {
                nud_gourde.Enabled = false;
            }
        }

        private void btn_retour_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void pic_box_sweat_Click(object sender, EventArgs e)
        {

        }

        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {

        }
    }
}
