Example #1
0
        private void MBoyMain_Init()
        {
            this.DateCourante = DateTime.Today;
            this.statusBar1.Text = "";

            try
            {
                if (this.SuperUser != null)
                {
                    string ut = "UTILISATEUR : ";
                    if (this.SuperUser.droitsuser == 1) { ut = "ADMINISTRATEUR : "; }
                    PersonneClass p = BDGestionAccess2013.GET_PERSONNEBY(this.SuperUser.persUserId);
                    if (p != null)
                    {
                        this.statusBar1.Text = ut + p.prenom + " " + p.nom;
                    }


                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);

            }
        }
Example #2
0
        private void CreerForm_Load(object sender, EventArgs e)
        {
            try
            {
                string app = Application.StartupPath;
                app       = app + @"\images\MBoy.ico";
                this.Icon = new Icon(app);

                this.ChargerLesTitres();
                this.ChargerLesUsers();
                this.HeureBox.Text  = DateTime.Now.ToShortTimeString();
                this.heureBox2.Text = DateTime.Now.AddHours(1).ToShortTimeString();



                if (this.ModeModif)
                {
                    int o = BDGestionAccess2013.COUNT("users", "select count(*) from users");


                    this.dateTimePicker1.Value = DateTime.Parse(this.TacheCouranteAmodifier.Datdeb);
                    this.dateTimePicker2.Value = DateTime.Parse(this.TacheCouranteAmodifier.Datfin);
                    this.checkBox1.Checked     = this.TacheCouranteAmodifier.Archive;

                    if (o > 0)
                    {
                        PersonneClass pepe = BDGestionAccess2013.GET_PERSONNEBY(this.TacheCouranteAmodifier.DestinatId);
                        if (pepe != null)
                        {
                            this.destCombo.SelectedItem = pepe.prenom + " " + pepe.nom;
                        }
                    }
                }
                else
                {
                    if (this.SuperUser != null)
                    {
                        PersonneClass meme = BDGestionAccess2013.GET_PERSONNEBY(this.SuperUser.persUserId);
                        if (meme != null)
                        {
                            this.destCombo.SelectedItem = meme.prenom + " " + meme.nom;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("erreur pepe " + "\r\n" + ex.Message);
            }
        }