コード例 #1
0
        public ChangeUser(InfoUser infoUserr)
        {
            InitializeComponent();
            infoUser         = infoUserr;
            tbNom.Text       = infoUser.Nom;
            tbPrenom.Text    = infoUser.Prenom;
            tbChangeMdp.Text = infoUser.Password;
            tbEmail.Text     = infoUser.Email;
            tbDpt.Text       = infoUser.Departement;
            switch (infoUser.Role)
            {
            case 0:
                rbInvite.Checked = true;
                break;

            case 1:
                rbOperateur.Checked = true;
                break;

            case 2:
                rbAdmin.Checked = true;
                break;
            }
            //tableau des logs du user
            this.dgUser.ColumnCount = 6;
            dgUser.Columns[4].Width = 150;
            dgUser.Columns[5].Width = 150;
            dgUser.Columns[0].Name  = "IDLog";
            dgUser.Columns[1].Name  = "Role";
            dgUser.Columns[2].Name  = "Nom";
            dgUser.Columns[3].Name  = "Prenom";
            dgUser.Columns[4].Name  = "DateDebut";
            dgUser.Columns[5].Name  = "DateFin";
            checkLogUser();
        }
コード例 #2
0
        /*public ChangeUser(string nom, string prenom, int role)
         * {
         *  InitializeComponent();
         *  tbNom.Text = nom;
         *  tbPrenom.Text = prenom;
         *  switch (role)
         *  {
         *      case 0:
         *          rbInvite.Checked = true;
         *          break;
         *      case 1:
         *          rbUtilisateur.Checked = true;
         *          break;
         *      case 2:
         *          rbAdmin.Checked = true;
         *          break;
         *  }
         *
         * }*/

        public ChangeUser(InfoUser infoUserr) //peut etre interressant a utiliser, mais faut voir si infoUser
        {
            InitializeComponent();
            infoUser         = infoUserr;
            tbNom.Text       = infoUser.Nom;
            tbPrenom.Text    = infoUser.Prenom;
            tbChangeMdp.Text = infoUser.Password;
            switch (infoUser.Role)
            {
            case 0:
                rbInvite.Checked = true;
                break;

            case 1:
                rbUtilisateur.Checked = true;
                break;

            case 2:
                rbAdmin.Checked = true;
                break;
            }
            //tableau des logs du user
            this.dgUser.ColumnCount = 6;
            dgUser.Columns[4].Width = 150;
            dgUser.Columns[5].Width = 150;
            dgUser.Columns[0].Name  = "IDLog";
            dgUser.Columns[1].Name  = "Role";
            dgUser.Columns[2].Name  = "Nom";
            dgUser.Columns[3].Name  = "Prenom";
            dgUser.Columns[4].Name  = "DateDebut";
            dgUser.Columns[5].Name  = "DateFin";
            checkLogUser();
        }
コード例 #3
0
 public FormInvite(int niveauUtilisateur, int idUtilisateur, string nomUtilisateur, string prenomUtilisateur, InfoUser infoUserr)
 {
     InitializeComponent();
     niveau   = niveauUtilisateur;
     id       = idUtilisateur;
     nom      = nomUtilisateur;
     prenom   = prenomUtilisateur;
     infoUser = infoUserr;
 }
コード例 #4
0
        private void dtUser_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //  string nom = dtLog.CurrentRow.Cells[2].Value.ToString();

            foreach (DataGridViewRow row in dtUser.SelectedRows)
            {
                InfoUser   clickedUser = row.DataBoundItem as InfoUser;
                ChangeUser changeUser  = new ChangeUser(clickedUser);
                changeUser.ShowDialog();
                checkUser();
            }
        }
コード例 #5
0
        public FormAdmin(InfoUser infoUserr)
        {
            InitializeComponent();
            infoUser = infoUserr;
            //dataGridLoggg
            this.dtLog.ColumnCount = 6;
            dtLog.Columns[4].Width = 150;
            dtLog.Columns[5].Width = 150;
            dtLog.Columns[0].Name  = "IDLog";
            dtLog.Columns[1].Name  = "Role";
            dtLog.Columns[2].Name  = "Nom";
            dtLog.Columns[3].Name  = "Prenom";
            dtLog.Columns[4].Name  = "DateDebut";
            dtLog.Columns[5].Name  = "DateFin";

            //dataGridFailConnection
            this.dgEchec.ColumnCount = 3;
            dgEchec.Columns[2].Width = 150;
            dgEchec.Columns[0].Name  = "IDechec";
            dgEchec.Columns[1].Name  = "Nom";
            dgEchec.Columns[2].Name  = "Date";

            //dataGridRemarques
            this.dgRemarques.ColumnCount = 4;
            dgRemarques.Columns[0].Width = 150;
            dgRemarques.Columns[2].Width = 250;
            dgRemarques.Columns[3].Width = 150;
            dgRemarques.Columns[0].Name  = "Demandeurs";
            dgRemarques.Columns[1].Name  = "Type";
            dgRemarques.Columns[2].Name  = "Commentaire";
            dgRemarques.Columns[3].Name  = "Date";

            //dataGridSalons
            this.dtSalons.ColumnCount = 4;
            dtSalons.Columns[1].Width = 200;
            dtSalons.Columns[2].Width = 150;
            dtSalons.Columns[2].DefaultCellStyle.Format = "yyyy-MM-dd";
            dtSalons.Columns[0].Name = "Id";
            dtSalons.Columns[1].Name = "Libelle";
            dtSalons.Columns[2].Name = "Date";
            dtSalons.Columns[3].Name = "Lieu";

            checkUser();
            checkLog();
            checkEchec();
            checkRemarques();
            checkSalons();
            //checkLogGraph();
        }
コード例 #6
0
        public FormOperateur(InfoUser infoUserr)
        {
            InitializeComponent();
            infoUser = infoUserr;

            //dataGridSalons
            this.dtSalons.ColumnCount = 4; //5
            dtSalons.Columns[1].Width = 200;
            dtSalons.Columns[2].Width = 150;
            dtSalons.Columns[2].DefaultCellStyle.Format = "yyyy-MM-dd";
            dtSalons.Columns[0].Name = "Id";
            dtSalons.Columns[1].Name = "Libelle";
            dtSalons.Columns[2].Name = "Date";
            dtSalons.Columns[3].Name = "Lieu";
            //dtSalons.Columns[4].Name = "NbParticipants"; // A FAIRE
            checkSalons();
        }
コード例 #7
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            InfoUser infoUser     = new InfoUser();
            Login    MonFormLogin = new Login(infoUser);

            MonFormLogin.ShowDialog();
            if (MonFormLogin.DialogResult == DialogResult.OK)
            {
                /* int niveauUtilisateur = MonFormLogin.niveauUtilisateur;
                 * int idUtilisateur = MonFormLogin.idUtilisateur;
                 * string nomUtilisateur = MonFormLogin.nomUtilisateur;
                 * string prenomUtilisateur = MonFormLogin.prenomUtilisateur;*/
                logSql(infoUser.Role, infoUser.Id, infoUser.Nom, infoUser.Prenom, "connection");
                MonFormLogin.Close();
                switch (infoUser.Role)
                {
                case 1:
                    //MessageBox.Show("Tu est un Utilisateur");
                    Application.Run(new FormUtilisateur(infoUser));
                    break;

                case 2:
                    //MessageBox.Show("Tu est un Admin");
                    Application.Run(new FormAdmin(infoUser));
                    break;

                case 0:
                default:
                    //MessageBox.Show("Tu est un Invite");
                    Application.Run(new FormInvite(infoUser));
                    break;
                }
                logSql(infoUser.Role, infoUser.Id, infoUser.Nom, infoUser.Prenom, "deconnection");
            }
            else
            {
                MonFormLogin.Close();
            }
            MessageBox.Show("Au revoir");
        }
コード例 #8
0
        /*public FormAdmin(int niveauUtilisateur, int idUtilisateur, string nomUtilisateur, string prenomUtilisateur, InfoUser infoUserr)
         * {
         *  InitializeComponent();
         *  role = niveauUtilisateur;
         *  id = idUtilisateur;
         *  nom = nomUtilisateur;
         *  prenom = prenomUtilisateur;
         *  infoUser = infoUserr;
         *  this.dtLog.ColumnCount = 6;
         *  dtLog.Columns[4].Width = 150;
         *  dtLog.Columns[5].Width = 150;
         *  dtLog.Columns[0].Name = "IDLog";
         *  dtLog.Columns[1].Name = "ID";
         *  dtLog.Columns[2].Name = "Nom";
         *  dtLog.Columns[3].Name = "Prenom";
         *  dtLog.Columns[4].Name = "Role";
         *  dtLog.Columns[5].Name = "DateDebut";
         *  dtLog.Columns[6].Name = "DateFin";
         *  checkLog();
         *  checkEchec();
         * }*/
        public FormAdmin(InfoUser infoUserr)
        {
            InitializeComponent();
            infoUser = infoUserr;
            //dataGridLog
            this.dtLog.ColumnCount = 6;
            dtLog.Columns[4].Width = 150;
            dtLog.Columns[5].Width = 150;
            dtLog.Columns[0].Name  = "IDLog";
            dtLog.Columns[1].Name  = "Role";
            dtLog.Columns[2].Name  = "Nom";
            dtLog.Columns[3].Name  = "Prenom";
            dtLog.Columns[4].Name  = "DateDebut";
            dtLog.Columns[5].Name  = "DateFin";

            //dataGridFailConnection
            this.dgEchec.ColumnCount = 3;
            dgEchec.Columns[2].Width = 150;
            dgEchec.Columns[0].Name  = "IDechec";
            dgEchec.Columns[1].Name  = "Nom";
            dgEchec.Columns[2].Name  = "Date";

            //dataGridRemarques
            this.dgRemarques.ColumnCount = 4;
            dgRemarques.Columns[0].Width = 150;
            dgRemarques.Columns[2].Width = 250;
            dgRemarques.Columns[3].Width = 150;
            dgRemarques.Columns[0].Name  = "Demandeurs";
            dgRemarques.Columns[1].Name  = "Type";
            dgRemarques.Columns[2].Name  = "Commentaire";
            dgRemarques.Columns[3].Name  = "Date";

            checkUser();
            checkLog();
            checkEchec();
            checkRemarques();
        }
コード例 #9
0
ファイル: Login.cs プロジェクト: DylanGil/BelleTableSalons
 public Login(InfoUser infoUserr)
 {
     InitializeComponent();
     this.infoUser = infoUserr;
 }
コード例 #10
0
 public FormInvite(InfoUser infoUserr)
 {
     InitializeComponent();
     infoUser = infoUserr;
 }
コード例 #11
0
 public FormUtilisateur(InfoUser infoUserr)
 {
     InitializeComponent();
     infoUser = infoUserr;
 }