Beispiel #1
0
 public AjouterFournisseurForm(UC_GestionFournisseur theCaller)
 {
     this.theCaller = theCaller;
     InitializeComponent();
 }
Beispiel #2
0
 public AjouterFournisseurForm(Fournisseur fournisseursToEdit, UC_GestionFournisseur theCaller)//used to edit fournisseur
 {
     this.fournisseursToEdit = fournisseursToEdit;
     this.theCaller          = theCaller;
     initCompo2EditFournisseur(fournisseursToEdit);
 }
Beispiel #3
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);
        }