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); } }
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 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); } }
public void CrediterCompteClient(CompteClient compteClient, double montant, Employe employe) { operationBLO = new OperationBLO(); epargneBLO = new EpargneBLO(); fondBLO = new FondBLO(); CompteClient oldCompteClient = compteClient; compteClient.Solde += montant; compteClientBLO[compteClientBLO.IndexOf(oldCompteClient)] = compteClient; if (compteClient.TypeCompte == TypeCompte.Epargne) { epargneBLO.AugmenterMontantEpargner(epargneBLO.RechercherEpargneEnCoursDuCompte(compteClient), montant, employe); } fondBLO.MettreArgentEnFond(employe, compteClient, montant, "toto tata"); operationBLO.AjouterOperation(TypeOperation.Dépot, employe, compteClient.Client, compteClient, montant, "toto tata"); }