Ejemplo n.º 1
0
 private void buttonItem10_Click(object sender, EventArgs e)
 {
     try
     {
         ProdFrm frm = new ProdFrm();
         frm.ShowDialog();
         if (frm.Done)
         {
             if (Admins.admin.AddProduct(frm.prod.Name, frm.prod.Description, (int)frm.prod.Quantity, frm.prod.Price, (byte)frm.prod.ProductType))
             {
                 MessageBoxEx.Show("Produit crée avec succès", "Produits", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch
     {
     }
 }
Ejemplo n.º 2
0
 private void buttonItem11_Click(object sender, EventArgs e)
 {
     try
     {
         GProduct prod = prodCtrl1.GetSelectedCommand();
         if (prod != null)
         {
             ProdFrm frm = new ProdFrm(prod);
             frm.ShowDialog();
             if (frm.Done)
             {
                 if (Admins.admin.ModifyProduct(prod.ProductID.ToString(), frm.prod.Name, frm.prod.Description, (int)frm.prod.Quantity, frm.prod.Price, (byte)frm.prod.ProductType))
                 {
                     MessageBoxEx.Show("Produit modifié " + prod.ProductID.ToString() + " avec succès", "Produits", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
         }
     }
     catch
     {
     }
 }