コード例 #1
0
        /// <summary>
        /// navigate to info client with id 0
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAjouter_Click(object sender, EventArgs e)
        {
            frmInfoClients clients = new frmInfoClients();

            clients.personneTransaction.iID = 0;
            clients.personne = personne;
            clients.btnPrecedent.Hide();
            clients.btnSuivant.Hide();
            clients.Text = clsCommun.TitreModeclient;
            clients.Show();
        }
コード例 #2
0
        /// <summary>
        /// open info client with id = selected row id in grid view
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnVisualiser_Click(object sender, EventArgs e)
        {
            try
            {
                if (personne == null || personne.iID <= 0)
                {
                    throw new Exception();
                }

                if (iID <= 0)
                {
                    throw new NoNullAllowedException(clsCommun.ErreurClientNonSelectionner);
                }

                frmInfoClients infoClients = new frmInfoClients();

                switch (personne.eNiveau)
                {
                case clsPersonne.enuNiveau.iCLIENT:
                    throw new Exception();

                case clsPersonne.enuNiveau.iCHEF_RAYON:
                    infoClients.Text = clsCommun.TitreModeChefRayon;
                    break;

                case clsPersonne.enuNiveau.iSUPERVISEUR:
                    infoClients.Text = clsCommun.TitreModeSuperviseur;
                    break;

                default:
                    throw new Exception();
                }

                infoClients.personne = personne;
                infoClients.personneTransaction.iID = iID;
                infoClients.Show();
                this.Close();
            }
            catch (NoNullAllowedException ex)
            {
                MessageBox.Show(ex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show(clsCommun.ErreurGeneriqueQuitterApplication);
                frmAuthentification authentification = new frmAuthentification();
                authentification.Show();
                this.Close();
            }
        }
コード例 #3
0
ファイル: Authentification.cs プロジェクト: kaveer/infomil
        private void Routage(clsPersonne personne)
        {
            frmGestionDesPersonnes gestionDesPersonnes = new frmGestionDesPersonnes();
            frmInfoClients         infoClients         = new frmInfoClients();

            /// make control visible based on user role
            /// this allow developer to used only one form for both chef de rayon and supervisor
            switch (personne.eNiveau)
            {
            case clsPersonne.enuNiveau.iCLIENT:
                infoClients.Text     = clsCommun.TitreModeclient;
                infoClients.personne = personne;
                infoClients.btnPrecedent.Hide();
                infoClients.btnSuivant.Hide();
                infoClients.personneTransaction = personne;
                infoClients.Show();
                this.Hide();
                break;

            case clsPersonne.enuNiveau.iCHEF_RAYON:
                gestionDesPersonnes.Text = clsCommun.TitreModeChefRayon;
                gestionDesPersonnes.lblInformation.Text = clsCommun.InformationModeChefRayon;
                gestionDesPersonnes.personne            = personne;
                gestionDesPersonnes.btnAjouter.Hide();
                gestionDesPersonnes.btnSupprimer.Hide();
                gestionDesPersonnes.btnVisualiser.Text = "Modifier";
                gestionDesPersonnes.Show();
                this.Hide();
                break;

            default:
                gestionDesPersonnes.Text = clsCommun.TitreModeSuperviseur;
                gestionDesPersonnes.lblInformation.Text = clsCommun.InformationModeSuperviseur;
                gestionDesPersonnes.personne            = personne;
                gestionDesPersonnes.Show();
                this.Hide();
                break;
            }
        }