Ejemplo n.º 1
0
        private void Menugen_Load(object sender, EventArgs e)
        {
            label1.Text = Program.LibSociete;
            label4.Text = Program.Exercice;

            this.Text = "GFACT/EPME V.1.0       [ Utilisateur:   " + Program.LibUser + "    (" + Program.TypUser + ") ]";

            if (Program.User == "00")
            {
                tVAToolStripMenuItem.Visible          = true;
                toolStripSeparator20.Visible          = true;
                purgeDonnéesToolStripMenuItem.Enabled = true;
            }

            if (Program.ISSaDmin)
            {
                sociétéToolStripMenuItem.Enabled = true;
                sauvegardeBasesDonnéesToolStripMenuItem.Enabled = true;
                restaurerBaseDonnéesToolStripMenuItem.Enabled   = true;
            }

            if (Program.ISaDmin)
            {
                utilisateurToolStripMenuItem.Enabled = true;
                numéroStéToolStripMenuItem.Enabled   = true;
                paramètresToolStripMenuItem.Enabled  = true;
            }

            if (Program.User == "00")
            {
                if (Program.ISDemo)
                {
                    demp form = new demp();
                    form.MdiParent = this;
                    form.Show();
                }
            }

            if (Program.ISDemo)
            {
                string  sqlcount = "Select Count(id) FROM eentcb";
                int     count    = 0;
                DataSet ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }

                sqlcount = "Select Count(id) FROM eentl";
                count    = 0;
                ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }

                sqlcount = "Select Count(id) FROM eentc";
                count    = 0;
                ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }
                if (count > 30)
                {
                }

                sqlcount = "Select Count(id) FROM eentcc";
                count    = 0;
                ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }

                sqlcount = "Select Count(id) FROM eentcb";
                count    = 0;
                ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }


                sqlcount = "Select Count(id) FROM eente";
                count    = 0;
                ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }


                sqlcount = "Select Count(id) FROM eentf";
                count    = 0;
                ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void Menugen_Load(object sender, EventArgs e)
        {
            label1.Text = Program.LibSociete;
            label6.Text = Program.LibMagasin;
            label4.Text = Program.Exercice;
            label5.Text = Program.LibEnteteMagasin;

            this.Text = "GCOM V.2.0       [ Utilisateur:   " + Program.LibUser + "    (" + Program.TypUser + ") ]";

            if (Program.User == "00")
            {
                tVAToolStripMenuItem.Visible          = true;
                toolStripSeparator20.Visible          = true;
                purgeDonnéesToolStripMenuItem.Enabled = true;
            }

            if (Program.ISSaDmin)
            {
                etatStockToolStripMenuItem.Visible                = true;
                valeurStockSociétéToolStripMenuItem.Visible       = true;
                organisationStockSociétéToolStripMenuItem.Visible = true;
                toolStripSeparator40.Visible     = true;
                toolStripSeparator25.Visible     = true;
                sociétéToolStripMenuItem.Enabled = true;
                magasinToolStripMenuItem.Enabled = true;
                sauvegardeBasesDonnéesToolStripMenuItem.Enabled = true;
                restaurerBaseDonnéesToolStripMenuItem.Enabled   = true;
            }

            if (Program.ISaDmin)
            {
                utilisateurToolStripMenuItem.Enabled             = true;
                dépôtToolStripMenuItem.Enabled                   = true;
                numéroToolStripMenuItem.Enabled                  = true;
                numéroStéToolStripMenuItem.Enabled               = true;
                organisationClientsToolStripMenuItem.Enabled     = true;
                organisationFournisseurToolStripMenuItem.Enabled = true;
                organisationStockToolStripMenuItem.Enabled       = true;
                paramètresToolStripMenuItem.Enabled              = true;
            }

            if (Program.User == "00")
            {
                if (Program.ISDemo)
                {
                    demp form = new demp();
                    form.MdiParent = this;
                    form.Show();
                }
            }

            if (Program.ISDemo)
            {
                string  sqlcount = "Select Count(id) FROM eentcb";
                int     count    = 0;
                DataSet ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }
                if (count > 30)
                {
                    buttonItem8.Enabled = false;
                }

                sqlcount = "Select Count(id) FROM eentl";
                count    = 0;
                ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }
                if (count > 30)
                {
                    buttonItem1.Enabled = false;
                }

                sqlcount = "Select Count(id) FROM eentc";
                count    = 0;
                ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }
                if (count > 30)
                {
                    buttonItem3.Enabled = false;
                    buttonItem7.Enabled = false;
                }

                sqlcount = "Select Count(id) FROM eentcc";
                count    = 0;
                ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }
                if (count > 30)
                {
                    buttonItem2.Enabled = false;
                }

                sqlcount = "Select Count(id) FROM eentcb";
                count    = 0;
                ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }
                if (count > 30)
                {
                    buttonItem8.Enabled = false;
                }

                sqlcount = "Select Count(id) FROM eente";
                count    = 0;
                ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }
                if (count > 30)
                {
                    buttonItem4.Enabled = false;
                }

                sqlcount = "Select Count(id) FROM eentf";
                count    = 0;
                ds       = met.recuperer_table(sqlcount);
                if (ds != null)
                {
                    if (ds.Tables.Count != 0)
                    {
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int.TryParse(ds.Tables[0].Rows[0].ItemArray[0] + "", out count);
                        }
                    }
                }
                if (count > 30)
                {
                    buttonItem5.Enabled = false;
                    buttonItem6.Enabled = false;
                }
            }
        }