Esempio n. 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var             App         = Application.OpenForms["Form1"] as Form1;
            Command_UC      uc          = (Command_UC)App.panelContainer.Controls[0];
            Add_Commande_UC uc_Commande = (Add_Commande_UC)uc.panelContainer.Controls[0];

            uc_Commande.txtProduct.Text = uc_Commande.ListProduits[int.Parse(this.Name)].Designation;
            uc_Commande.usedProduct     = int.Parse(this.Name);
            uc_Commande.txtQte.Text     = "0";
            uc_Commande.lblUnite.Text   = uc_Commande.ListProduits[int.Parse(this.Name)].Unite;
        }
Esempio n. 2
0
        private void supprimerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var             App         = Application.OpenForms["Form1"] as Form1;
            Command_UC      uc          = (Command_UC)App.panelContainer.Controls[0];
            Add_Commande_UC uc_Commande = (Add_Commande_UC)uc.panelContainer.Controls[0];
            int             index       = uc_Commande.getPrecedentControl(int.Parse(lblCodeproduit.Text));

            if (index != -1)
            {
                uc_Commande.panelCommandeProducts.Controls.RemoveAt(index);
            }
        }