示例#1
0
 private void pictureBoxBasket_Click(object sender, EventArgs e)
 {
     if (Object.Equals(a, null))
     {
         a = new FormPagnierVentes();
         flowLayoutPagnierProduitVentes = (FlowLayoutPanel)a.Controls[0];
     }
     if (!Object.Equals(a, null) && flowLayoutPagnierProduitVentes.Controls.Count > 0)
     {
         a.Show();
     }
     else
     {
         MessageBox.Show("Le pagnier est vide !");
     }
 }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (previousBtn == (sender as Button))
            {
                return;
            }
            if ((sender as Button).Name == "BtnGestionProduits")
            {
                btnViewAll_Click(null, null);
                panelGestionVentes.Visible  = false;
                panelSM_GV.Visible          = false;
                panelCommandes.Visible      = false;
                panelGestionProduit.Visible = true;
            }
            if ((sender as Button).Name == "BtnGestionVentes")
            {
                if (a == null)
                {
                    a = new FormPagnierVentes();
                    flowLayoutPagnierProduitVentes = (FlowLayoutPanel)a.Controls[1];
                    a.FormClosing    += new System.Windows.Forms.FormClosingEventHandler(this.handel_AfterCloseForm);
                    a.VisibleChanged += new System.EventHandler(this.handel2_AfterCloseForm);
                    Button BtnaffecterFacture = findAjouterFactureBtn();
                    BtnaffecterFacture.Click += new System.EventHandler(this.writeFactureInlog);
                }
                refreshFlowLayoutPVente();
                panelGestionProduit.Visible = false;
                panelCommandes.Visible      = false;
                panelGestionVentes.Visible  = true;
                panelSM_GV.Visible          = true;
            }
            if ((sender as Button).Name == "buttonCommandes")
            {
                var db = new dbContext();

                if (formAcheterProduits == null)
                {
                    formAcheterProduits = new FormAcheterProduits();
                }
                if (this.uc_Commandes == null)
                {
                    this.uc_Commandes = new UC_Gestion_Commades(db.Commandes.ToList <Commande>(), formAcheterProduits);
                }
                panelCommandes.Controls.Clear();
                panelCommandes.Controls.Add(uc_Commandes);
                panelCommandes.Controls[0].Dock = System.Windows.Forms.DockStyle.Fill;
                panelGestionProduit.Visible     = false;
                panelGestionVentes.Visible      = false;
                panelSM_GV.Visible     = false;
                panelCommandes.Visible = true;
            }
            if ((sender as Button).Name == "buttonForunisseur")
            {
                var db = new dbContext();
                uc = new UC_GestionFournisseur(db.Fournisseurs.ToList <Fournisseur>());
                panelCommandes.Controls.Clear();
                panelCommandes.Controls.Add(uc);
                panelCommandes.Controls[0].Dock = System.Windows.Forms.DockStyle.Fill;
                panelGestionProduit.Visible     = false;
                panelGestionVentes.Visible      = false;
                panelSM_GV.Visible     = false;
                panelCommandes.Visible = true;
            }

            previousBtn.BackColor        = Color.FromArgb(0, 53, 92);
            previousBtn                  = (sender as Button);
            checkedLinePanel.Height      = (sender as Button).Height;
            checkedLinePanel.Top         = (sender as Button).Top;
            (sender as Button).BackColor = Color.FromArgb(13, 72, 114);
        }