private static void RealAddMoney(Person person) { ServiceProject.ServiceCardClient client = new ServiceProject.ServiceCardClient(); Console.WriteLine("How much money do you want to add to this user ?"); string amount = Console.ReadLine(); double amountDouble = Double.Parse(amount); client.AddMoneyToCard(person.Id, amountDouble); person = client.GetPersonById(person.Id); Console.WriteLine($"New balance : CHF {person.Balance}.- "); }
private static void RealAddQuotas(Person person) { ServiceProject.ServiceCardClient client = new ServiceProject.ServiceCardClient(); PrintType printTypeSpec = null; while (printTypeSpec == null) { Console.WriteLine("Choose which quotas you want to add ?"); DisplayQuotas(); string quotaChoice = Console.ReadLine(); int quotaChoiceInt = Int32.Parse(quotaChoice); printTypeSpec = client.GetPrintTypeById(quotaChoiceInt); } Console.WriteLine("How much of this quotas do you want to add? "); string numberOfCopies = Console.ReadLine(); int numberOfCopiesInt = Int32.Parse(numberOfCopies); client.AddMoneyToCard(person.Id, printTypeSpec.Price * numberOfCopiesInt); Person personRefresh = client.GetPersonById(person.Id); Console.WriteLine($"You have just added {numberOfCopiesInt} {printTypeSpec.Description} {printTypeSpec.Color} {printTypeSpec.RectoVerso} for CHF {printTypeSpec.Price * numberOfCopiesInt}.- to {personRefresh.FirstName} {personRefresh.LastName}"); Console.WriteLine($"New balance : CHF {personRefresh.Balance}.- "); }