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(); }
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"); } }
public void ValiderCredit(Credit credit, CompteClient compteClient, Employe employe) { compteClientBLO = new CompteClientBLO(); operationBLO = new OperationBLO(); Credit oldCredit = credit; if (compteClient != null) { compteClientBLO.CrediterCompteClient(compteClient, credit.MontantEmprunte, employe); } credit.StatutCredit = StatutCredit.Non_remboursé; credit.DateCreditValidation = DateTime.Now; creditBLO[creditBLO.IndexOf(oldCredit)] = credit; operationBLO.AjouterOperation(TypeOperation.Remboursement, employe, credit.Client, new CompteClient("Indefini"), credit.MontantEmprunte, "toto tata"); }
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); } }