Beispiel #1
0
        public void ValiderTransactionCompteCourant(Transaction transaction, Employe employe)
        {
            operationBLO    = new OperationBLO();
            compteClientBLO = new CompteClientBLO();
            fondBLO         = new FondBLO();

            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");
            }
            else if (transaction.TypeTransaction == TypeTransaction.Retrait)
            {
                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");
            }
            else
            {
                compteClientBLO.CrediterUnAutreCompte(transaction.CompteClientEmetteur, transaction.CompteClientDestinataire, transaction.Montant, employe);
                operationBLO.AjouterOperation(TypeOperation.Transfert_inter_compte, employe, transaction.CompteClientEmetteur.Client,
                                              transaction.CompteClientEmetteur, transaction.Montant, "toto tata");
            }
        }
Beispiel #2
0
        public void InitierTransaction(TypeCompte typeCompte, TypeTransaction typeTransaction, Epargne epargne, CompteClient compteClientEmetteur,
                                       CompteClient compteClientDestinataire, Employe employe, double montant, int nombreJourAttente)
        {
            operationBLO = new OperationBLO();
            transactionBLO.Add(new Transaction(CodeTransaction(typeTransaction), typeCompte, typeTransaction, epargne, DateTime.Now, compteClientEmetteur,
                                               compteClientDestinataire, employe, new Employe("Indefini"),
                                               montant, StatutTransaction.En_cours_de_validité, nombreJourAttente));

            if (typeTransaction == TypeTransaction.Dépot)
            {
                operationBLO.AjouterOperation(TypeOperation.Dépot, employe, compteClientEmetteur.Client, compteClientEmetteur, montant, "toto tata");
            }

            else if (typeTransaction == TypeTransaction.Retrait)
            {
                operationBLO.AjouterOperation(TypeOperation.Retrait, employe, compteClientEmetteur.Client, compteClientEmetteur, montant, "toto tata");
            }

            else
            {
                operationBLO.AjouterOperation(TypeOperation.Transfert_inter_compte, employe, compteClientEmetteur.Client, compteClientEmetteur, montant, "toto tata");
            }

            new IdentifiantBLO().AddIdTransaction();
        }
Beispiel #3
0
 public void SupprimerTransaction(Transaction transaction, Employe employe)
 {
     operationBLO = new OperationBLO();
     transactionBLO.Remove(transaction);
     operationBLO.AjouterOperation(TypeOperation.Annulation, employe, transaction.CompteClientEmetteur.Client, transaction.CompteClientEmetteur,
                                   transaction.Montant, "toto tata");
 }
Beispiel #4
0
        public void SupprimerBeneficier(Beneficier beneficier, Employe employe)
        {
            operationBLO = new OperationBLO();
            beneficierBLO.Remove(beneficier);

            operationBLO.AjouterOperation(TypeOperation.Suppression, employe, beneficier.CompteClient.Client, beneficier.CompteClient, beneficier.Pourcentage, "toto tata");
        }
Beispiel #5
0
        public void SupprimerClient(Client client, Employe employe)
        {
            operationBLO = new OperationBLO();
            clientBLO.Remove(client);

            operationBLO.AjouterOperation(TypeOperation.Suppression, employe, client, new CompteClient("Indefini"), 0, "toto tata");
        }
Beispiel #6
0
        public void SupprimerButCredit(ButCredit ButCredit, Employe employe)
        {
            operationBLO = new OperationBLO();
            butCreditBLO.Remove(ButCredit);

            operationBLO.AjouterOperation(TypeOperation.Suppression, employe, new Client("Indefini"), new CompteClient("Indefini"), 0, "toto tata");
        }
Beispiel #7
0
        public void AjouterButCredit(string nom, Employe employe)
        {
            operationBLO = new OperationBLO();
            butCreditBLO.Add(new ButCredit(nom));

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, new Client("Indefini"), new CompteClient("Indefini"), 0, "toto tata");
        }
Beispiel #8
0
        public void SupprimerVille(Ville ville, Employe employe)
        {
            operationBLO = new OperationBLO();
            villeBLO.Remove(ville);

            operationBLO.AjouterOperation(TypeOperation.Suppression, employe, new Client("Indefini"), new CompteClient("Indefini"), 0, "toto tata");
        }
Beispiel #9
0
        public void SupprimerPartSociale(PartSociale partSociale, Employe employe)
        {
            operationBLO = new OperationBLO();
            partSocialeBLO.Remove(partSociale);

            operationBLO.AjouterOperation(TypeOperation.Suppression, employe, partSociale.CompteClient.Client, partSociale.CompteClient, partSociale.Montant, "toto tata");
        }
Beispiel #10
0
        public void SupprimerSalarie(Salarie salarie, Employe employe)
        {
            operationBLO = new OperationBLO();
            salarieBLO.Remove(salarie);

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, salarie.CompteClientEmploye.Client, new CompteClient("Indefini"), salarie.MontantSalaire, "toto tata");
        }
Beispiel #11
0
        public void SupprimerPays(Pays pays, Employe employe)
        {
            operationBLO = new OperationBLO();
            paysBLO.Remove(pays);

            operationBLO.AjouterOperation(TypeOperation.Suppression, employe, new Client("Indefini"), new CompteClient("Indefini"), 0, "toto tata");
        }
Beispiel #12
0
 public void SupprimerRemboursement(Remboursement remboursement, Employe employe)
 {
     operationBLO = new OperationBLO();
     remboursementBLO.Remove(remboursement);
     operationBLO.AjouterOperation(TypeOperation.Suppression, employe, remboursement.Credit.Client, new CompteClient("Indefini"),
                                   remboursement.Montant, "toto tata");
 }
Beispiel #13
0
        public void ActiverCompteClient(CompteClient compteClient, double montantDepot, Employe employe)
        {
            fondBLO = new FondBLO();

            double montant;

            if (compteClient.StatutCompte == StatutCompte.En_attente_de_validité)
            {
                montant = parametreGeneralBLO.TousParametreGenerals[0].MontantDeCreationCompte;
            }
            else
            {
                montant = parametreGeneralBLO.TousParametreGenerals[0].FraiesDebloquerCompte;
            }

            if (montant > 0)
            {
                fondBLO.MettreArgentEnFond(employe, compteClient, montant, "toto tata");
            }

            CompteClient oldCompteClient = compteClient;

            compteClient.StatutCompte = StatutCompte.Activé;
            compteClientBLO[compteClientBLO.IndexOf(oldCompteClient)] = compteClient;

            operationBLO.AjouterOperation(TypeOperation.Activation, employe, compteClient.Client, compteClient, montant, "toto tata");

            if (montantDepot > 0)
            {
                CrediterCompteClient(compteClient, montantDepot, employe);
            }
        }
Beispiel #14
0
        public void AjouterClient(string nomComplet, DateTime?dateNaissance, string lieuNaissance, StatutSexe?sexe, string numeroCNI,
                                  string numeroTelephone1, string numeroTelephone2, Pays pays, Ville ville, string adresse, string photoProfil,
                                  string profession, TypeCompte typeCompte, TypeAppartenantCompteEpargne?typeAppartenantCompteEpargne,
                                  string nomStructure, Employe employe, int nombreMois, double montant)
        {
            operationBLO = new OperationBLO();

            fichierStockeBLO = new FichierStockeBLO();

            compteClientBLO = new CompteClientBLO();

            Client client = new Client(CodeClient, nomComplet, dateNaissance, lieuNaissance, sexe, numeroCNI, numeroTelephone1,
                                       numeroTelephone2, pays, ville, adresse, photoProfil, DateTime.Now, profession, StatutClient.Desactivé);

            clientBLO.Add(client);

            compteClientBLO.AjouterCompteClient(client, typeCompte, typeAppartenantCompteEpargne, nomStructure, nombreMois, montant, employe);

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, client,
                                          compteClientBLO.RechercherUnCompte(compteClientBLO.CodeCompteClient(typeCompte, typeAppartenantCompteEpargne)), 0, "toto tata");

            if (photoProfil != string.Empty)
            {
                fichierStockeBLO.AjouterFichierStocke($"Photo du client {CodeClient}", photoProfil, client, new Garantie(0), StatutStockage.Image_des_clients, employe);
            }

            new IdentifiantBLO().AddIdClient();
        }
Beispiel #15
0
        public void SupprimerAvaliste(Avaliste avaliste, Employe employe)
        {
            operationBLO = new OperationBLO();
            avalisteBLO.Remove(avaliste);

            operationBLO.AjouterOperation(TypeOperation.Suppression, employe, avaliste.Garantie.Credit.Client, new CompteClient("Indefini"), avaliste.MontantParMois, "toto tata");
        }
Beispiel #16
0
        public void AjouterCompteClient(Client client, TypeCompte typeCompte, TypeAppartenantCompteEpargne?typeAppartenantCompteEpargne,
                                        string nomStructure, int nombreMois, double montant, Employe employe)
        {
            epargneBLO     = new EpargneBLO();
            operationBLO   = new OperationBLO();
            transactionBLO = new TransactionBLO();

            int          idEpargne    = new IdentifiantBLO().IdEpargne;
            CompteClient compteClient = new CompteClient(CodeCompteClient(typeCompte, typeAppartenantCompteEpargne), client, typeCompte, typeAppartenantCompteEpargne,
                                                         nomStructure, 0, StatutCompte.En_attente_de_validité, DateTime.Now);

            compteClientBLO.Add(compteClient);

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, client, compteClient, 0, "toto tata");

            Epargne epargne = new Epargne(0);

            if (typeCompte == TypeCompte.Epargne)
            {
                epargneBLO.AjouterEpargne(compteClient, nombreMois, 0, employe);

                epargne = epargneBLO.RechercheEpargne(idEpargne);
            }

            transactionBLO.InitierTransaction(typeCompte, TypeTransaction.Dépot, epargne, compteClient, new CompteClient("Indefini"), employe, montant, 0);

            new IdentifiantBLO().AddIdCompteClient();
        }
Beispiel #17
0
        public void ModifierEmploye(Employe employeModifie, string nomComplet, DateTime?dateNaissance, string lieuNaissance, StatutSexe?sexe,
                                    string numeroCNI, string numeroTelephone1, string numeroTelephone2, Pays pays, Ville ville, string adresse, string photoProfil, Employe employeModifieur)
        {
            operationBLO = new OperationBLO();

            int index = employeBLO.IndexOf(employeModifie);

            string fileName = employeModifie.PhotoProfil;

            employeModifie.NomComplet       = nomComplet;
            employeModifie.DateNaissance    = dateNaissance;
            employeModifie.LieuNaissance    = lieuNaissance;
            employeModifie.Sexe             = sexe;
            employeModifie.NumeroCNI        = numeroCNI;
            employeModifie.NumeroTelephone1 = numeroTelephone1;
            employeModifie.NumeroTelephone2 = numeroTelephone2;
            employeModifie.Pays             = pays;
            employeModifie.Ville            = ville;
            employeModifie.NomUtilisateur   = NomUtilisateur(nomComplet, employeModifie.CodeEmploye);
            employeModifie.Adresse          = adresse;
            employeModifie.PhotoProfil      = photoProfil;
            if (photoProfil != fileName)
            {
                fichierStockeBLO.AjouterFichierStocke($"Photo de l'employe {employeModifie.CodeEmploye}", photoProfil, new Client("Indefini"), new Garantie(0),
                                                      StatutStockage.Image_des_employés, employeModifieur);
            }
            employeBLO[index] = employeModifie;

            operationBLO.AjouterOperation(TypeOperation.Modification, employeModifieur, new Client("Indefini"), new CompteClient("Indefini"), 0, "toto tata");
        }
Beispiel #18
0
        public void SupprimerDevise(Devise devise, Employe employe)
        {
            operationBLO = new OperationBLO();
            deviseBLO.Remove(devise);

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, new Client("Indefini"), new CompteClient("Indefini"), 0, "toto tata");
        }
Beispiel #19
0
        public void SupprimerCredit(Credit credit, Employe employe)
        {
            operationBLO = new OperationBLO();
            creditBLO.Remove(credit);

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, credit.Client, new CompteClient("Indefini"), credit.MontantEmprunte, "toto tata");
        }
Beispiel #20
0
        public void EditerClient(Client client, string nomComplet, DateTime dateNaissance, string lieuNaissance, StatutSexe sexe, string numeroCNI,
                                 string numeroTelephone1, string numeroTelephone2, Pays pays, Ville ville, string adresse, string photoProfil, string profession, Employe employe)
        {
            operationBLO     = new OperationBLO();
            fichierStockeBLO = new FichierStockeBLO();

            int index = clientBLO.IndexOf(client);

            string fileName = client.PhotoProfil;

            client.NomComplet       = nomComplet;
            client.DateNaissance    = dateNaissance;
            client.LieuNaissance    = lieuNaissance;
            client.Sexe             = sexe;
            client.NumeroCNI        = numeroCNI;
            client.NumeroTelephone1 = numeroTelephone1;
            client.NumeroTelephone2 = numeroTelephone2;
            client.Pays             = pays;
            client.Ville            = ville;
            client.Adresse          = adresse;
            client.PhotoProfil      = photoProfil;
            client.Profession       = profession;

            if (photoProfil != fileName)
            {
                fichierStockeBLO.AjouterFichierStocke($"Photo du client {client.CodeClient}", photoProfil, client, new Garantie(0), StatutStockage.Image_des_clients, employe);
            }

            clientBLO[index] = client;

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, client, new CompteClient("Indefini"), 0, "toto tata");
        }
Beispiel #21
0
        public void AjouterDevise(string nomDevise, string symboleDevise, Employe employe)
        {
            operationBLO = new OperationBLO();

            deviseBLO.Add(new Devise(nomDevise, symboleDevise));

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, new Client("Indefini"), new CompteClient("Indefini"), 0, "toto tata");
        }
Beispiel #22
0
        public void SupprimerCompteClient(CompteClient compteClient, Employe employe)
        {
            operationBLO = new OperationBLO();

            compteClientBLO.Remove(compteClient);

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, compteClient.Client, compteClient, 0, "toto tata");
        }
Beispiel #23
0
        public void AjouterAvaliste(Garantie garantie, string nomComplet, string profession, string description, double montantParMois, Employe employe)
        {
            operationBLO = new OperationBLO();
            avalisteBLO.Add(new Avaliste(new IdentifiantBLO().IdAvaliste, garantie, nomComplet, profession, description, montantParMois));
            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, garantie.Credit.Client, new CompteClient("Indefini"), montantParMois, "toto tata");

            new IdentifiantBLO().AddIdAvaliste();
        }
Beispiel #24
0
        public void SupprimerFichierStocke(FichierStocke fichierStocke, Employe employe)
        {
            operationBLO = new OperationBLO();
            fichierStockeBLO.Remove(fichierStocke);

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, fichierStocke.Client, new CompteClient("Indefini"),
                                          fichierStocke.Garantie.MontantEvaluation, "toto tata");
        }
Beispiel #25
0
        public void CrediterUnAutreCompte(CompteClient compteClientDebiter, CompteClient compteClientCrediter, double montant, Employe employe)
        {
            operationBLO = new OperationBLO();
            DebiterCompteClient(compteClientDebiter, montant, employe);
            CrediterCompteClient(compteClientCrediter, montant, employe);

            operationBLO.AjouterOperation(TypeOperation.Transfert_inter_compte, employe, compteClientDebiter.Client, compteClientDebiter, montant, "toto tata");
        }
Beispiel #26
0
        public void SupprimerEmploye(Employe employeSupprime, Employe employeSupprimeur)
        {
            operationBLO = new OperationBLO();

            employeBLO.Remove(employeSupprime);

            operationBLO.AjouterOperation(TypeOperation.Embauche, employeSupprimeur, new Client("Indefini"), new CompteClient("Indefini"), 0, "toto tata");
        }
Beispiel #27
0
        public void AjouterPartSociale(CompteClient compteClient, StatutPartSociale statutPartSociale, double montant, Employe employe)
        {
            operationBLO = new OperationBLO();

            partSocialeBLO.Add(new PartSociale(compteClient, statutPartSociale, montant));

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, compteClient.Client, compteClient, montant, "toto tata");
        }
Beispiel #28
0
        public void AjouterBeneficier(string nom, string descriptionCondition, int pourcentage, CompteClient compteClient, Employe employe)
        {
            operationBLO = new OperationBLO();
            beneficierBLO.Add(new Beneficier(new IdentifiantBLO().IdBeneficier, nom, descriptionCondition, pourcentage, compteClient));

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, compteClient.Client, compteClient, 0, "toto tata");

            new IdentifiantBLO().AddIdBeneficier();
        }
Beispiel #29
0
        public void SupprimerGarantie(Garantie garantie, Employe employe)
        {
            operationBLO = new OperationBLO();

            garantieBLO.Remove(garantie);

            operationBLO.AjouterOperation(TypeOperation.Suppression, employe, garantie.Credit.Client, new CompteClient("Indefini"),
                                          garantie.MontantEvaluation, "Plus important");
        }
Beispiel #30
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);
            }
        }