Exemplo n.º 1
0
        public bool VerifierValidite(PartSociale partSociale, double montant)
        {
            parametreGeneralBLO = new ParametreGeneralBLO();
            if (montant > 0 && parametreGeneralBLO.TousParametreGenerals[0].MontantPartSociale >= (partSociale.Montant = montant))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public void ValiderTransactionCompteEpargne(Transaction transaction, Employe employe)
        {
            parametreGeneralBLO = new ParametreGeneralBLO();
            operationBLO        = new OperationBLO();
            compteClientBLO     = new CompteClientBLO();
            fondBLO             = new FondBLO();
            epargneBLO          = new EpargneBLO();
            Transaction oldTransaction = transaction;

            int index = transactionBLO.IndexOf(transaction);

            transaction.StatutTransaction = StatutTransaction.Validé;
            transaction.EmployeValideur   = employe;
            transactionBLO[index]         = transaction;

            if (transaction.TypeTransaction == TypeTransaction.Dépot)
            {
                compteClientBLO.CrediterCompteClient(transaction.CompteClientEmetteur, transaction.Montant, employe);
                fondBLO.MettreArgentEnFond(employe, transaction.CompteClientDestinataire, transaction.Montant, "toto tata");
                operationBLO.AjouterOperation(TypeOperation.Dépot, employe, transaction.CompteClientEmetteur.Client, transaction.CompteClientEmetteur,
                                              transaction.Montant, "toto tata");
                epargneBLO.AugmenterMontantEpargner(transaction.Epargne, transaction.Montant, employe);
            }

            else if (transaction.TypeTransaction == TypeTransaction.Retrait && oldTransaction.StatutTransaction == StatutTransaction.Avisé &&
                     (DateTime.Compare(oldTransaction.DateTransaction.AddDays(oldTransaction.NombreJourAttente), DateTime.Now)) >= 0)
            {
                compteClientBLO.DebiterCompteClient(transaction.CompteClientEmetteur, transaction.Montant, employe);
                fondBLO.SortirArgentEnFond(employe, transaction.CompteClientDestinataire, transaction.Montant, "toto tata");
                operationBLO.AjouterOperation(TypeOperation.Retrait, employe, transaction.CompteClientEmetteur.Client, transaction.CompteClientEmetteur,
                                              transaction.Montant, "toto tata");
                epargneBLO.ReduireMontantEpargner(transaction.Epargne, transaction.Montant, employe);
            }

            else if (transaction.TypeTransaction == TypeTransaction.Retrait && !VerifierSiAvis(transaction))
            {
                double montant = (transaction.Montant + ((parametreGeneralBLO.TousParametreGenerals[0].PourcentageRetraitEpargneSansAvis * transaction.Montant) / 100));
                compteClientBLO.DebiterCompteClient(transaction.CompteClientEmetteur, montant, employe);
                fondBLO.SortirArgentEnFond(employe, transaction.CompteClientDestinataire, transaction.Montant, "toto tata");
                operationBLO.AjouterOperation(TypeOperation.Retrait, employe, transaction.CompteClientEmetteur.Client, transaction.CompteClientEmetteur,
                                              montant, "toto tata");
                epargneBLO.ReduireMontantEpargner(transaction.Epargne, montant, employe);
            }
        }