//public static void TestCompte () //{ // Client c1 = new Client("nom1", "prenom1", "*****@*****.**", "0202020202", new DateTime(1991, 06, 02)); // Client c2 = new Client("nom2", "prenom2", "*****@*****.**", "0202020202", new DateTime(1991, 06, 02)); // Compte cpt1, cpt2; // cpt1 = new Compte(c1, "101" , 500 , "2021-03-01"); // cpt2 = new Compte(c2, "102"); // cpt1.Crediter(100000); // for (int i = 0; i < 15; i++) // cpt1.Crediter(100 + i); // cpt2.Crediter(300); // if (cpt2.Debiter(500)) // Console.WriteLine("Debit impossible"); // Console.WriteLine(cpt1.Solde); // Console.WriteLine(cpt2.Solde); // Transaction.Virement(cpt1, cpt2, 100); // Console.WriteLine(cpt1.ToString()); // Console.WriteLine(cpt2.ToString()); // Console.WriteLine(cpt1.GetHistorique()); // //cpt1.DebitDiffere(100 , "2021-04-01"); // // appel implicite du deconstructeur // //(string num, double solde, _) = cpt1; // //Console.WriteLine($"Info du compte cpt1 : {num} {solde}"); //} public static void TestCompteCourant() { Client c1 = new Client("nom1", "prenom1", "*****@*****.**", "0202020202", new DateTime(1991, 06, 02)); CompteCourant cpt1; cpt1 = new CompteCourant(c1, "101", 500, "2021-03-01", 200); cpt1.Crediter(200); cpt1.Debiter(800); Console.WriteLine(cpt1); }
public static void Demo() { ATM atm = new ATM(new TiroirArgentUSB(), new CreateurTransactionBanqueXYZ()); /// ... ICompte compte = new CompteCourant(); // ... decimal montant = 123.00m; // ... /// ... atm.Retirer(compte, montant); }
public static void Demo() { ATM atm = new ATM(new TiroirArgentUSB(), new CreateurTransactionBanqueXYZ()); /// ... ICompte compte = new CompteCourant(); // ... decimal montant = 123 .00m; // ... /// ... atm.Retirer(compte, montant); }
internal void Demo61() { CompteCourant CC = new CompteCourant(); CompteEpargne CE = new CompteEpargne(); CompteAssVie CA1 = new CompteAssVie(); CompteAssVie CA2 = new CompteAssVie(); //Activité du compte courant : CC.Deposer(500); CC.Deposer(250); CC.Retirer(120); CC.RetirerFraisDeCarte(); //Activité du compte épargne : CE.Deposer(3000); //Activité du compte Ass vie 1 CA1.Deposer(5000); CA1.Deposer(3000); CA1.Retirer(1000); //Activité du compte Ass vie 2 CA2.Deposer(3000); CA2.Deposer(3000); CA2.Retirer(5000); //PorteFeuille de comptes au sein d'une liste List <ICompte> lstPorteFeuille = new List <ICompte>() { CC, CE, CA1, CA2 }; double soldeTotal = 0; foreach (ICompte item in lstPorteFeuille) { soldeTotal += item.Solde; Console.WriteLine(soldeTotal); } Console.WriteLine("Le cumul des soldes des comptes donne : {0:N2}", soldeTotal); }
public ActionResult Create(CompteViewModel cvm) { try { // TODO: Add insert logic here CompteCourantService CS = new CompteCourantService(); CompteCourant account = new CompteCourant() { AgenceKey = 1, CIN = cvm.CIN, DateOuverture = cvm.DateOuverture, Solde = cvm.Solde, DecouvertMax = 240f }; CS.Add(account); CS.Commit(); Session["Cin"] = cvm.CIN; return(RedirectToAction("Index")); } catch { return(View()); } }