/// <summary> /// Allow new user to create a new Profile /// </summary> public static void ProfilCreationPage() { Console.Clear(); Console.WriteLine("*******************************"); Console.WriteLine("**** Profil Creation Page *****"); Console.WriteLine("*******************************"); string login = Menu.userLoginCreation(); string password = Menu.userPasswordCreation(); Devise userCurrency = Menu.userFavouriteCurrencyCreation(); Profil currentProfil = new Profil(login, password, userCurrency, ""); Menu.userCategoryCreation(currentProfil); Console.WriteLine("\n****************************************"); Console.WriteLine("Profil saved. You will be able to log in.\nPlease push a key to continue..."); Console.WriteLine("******************************************"); Console.ReadKey(); Menu.HomePage(); }
public static void checkHomeChoice() { Console.WriteLine("Enter your choice :"); bool correctChoice=false; while (!correctChoice) { switch (Convert.ToInt32(Console.ReadLine ())) { case 1: correctChoice = true; User.transactionMenu (); break; case 2: correctChoice = true; User.budgetMenu (); break; case 3: correctChoice = true; User.resumeMenu (); break; case 4: correctChoice = true; User.categoriesMenu (); break; case 5: correctChoice = true; CurrentUser = null; Console.WriteLine ("You are disconnected. Press a key to come back to the Home Page."); Console.ReadKey (); Menu.HomePage (); break; case 6: correctChoice = true; User.DeleteAccount (); break; default: Console.WriteLine ("Enter the number of the action you want accomplish :"); break; } } }
/// <summary> /// Ask the user for create his own subcategorie /// </summary> public static void userCategoryCreation(Profil currentProfil) { Console.WriteLine("Please select in what categories are you interested : "); List <Category> categories = db.Query <Category> ("SELECT * FROM Category"); foreach (Category c in categories) { Console.WriteLine("(ID " + c.Id + ") : " + c.Name + "(" + c.Description + ")"); } Console.WriteLine("Enter categories IDs separated with '-' : "); List <string> listIds = new List <string> (Console.ReadLine().Split(new char[] { '-' })); foreach (string id in listIds) { try { currentProfil.AddSubCategory(db.Get <Category> (Convert.ToInt32(id))); } catch (Exception e) { Debug.WriteLine("Exception : " + e); Console.WriteLine("The last ID was not correct. Precedents IDs were saved. You will be able to manage your categories later."); } } }
/// <summary> /// Ask the user for create his own subcategorie /// </summary> public static void userCategoryCreation(Profil currentProfil) { Console.WriteLine ("Please select in what categories are you interested : "); List<Category> categories = db.Query<Category> ("SELECT * FROM Category"); foreach (Category c in categories) { Console.WriteLine ("(ID " + c.Id +") : "+ c.Name +"("+c.Description+")"); } Console.WriteLine ("Enter categories IDs separated with '-' : "); List<string> listIds = new List<string> (Console.ReadLine ().Split (new char[] { '-' })); foreach (string id in listIds) { try { currentProfil.AddSubCategory(db.Get<Category> (Convert.ToInt32(id))); } catch (Exception e) { Debug.WriteLine("Exception : "+e); Console.WriteLine ("The last ID was not correct. Precedents IDs were saved. You will be able to manage your categories later."); } } }
/// <summary> /// Allow new user to create a new Profile /// </summary> public static void ProfilCreationPage() { Console.Clear (); Console.WriteLine ("*******************************"); Console.WriteLine ("**** Profil Creation Page *****"); Console.WriteLine ("*******************************"); string login = Menu.userLoginCreation (); string password = Menu.userPasswordCreation (); Devise userCurrency = Menu.userFavouriteCurrencyCreation (); Profil currentProfil = new Profil (login, password, userCurrency, ""); Menu.userCategoryCreation (currentProfil); Console.WriteLine ("\n****************************************"); Console.WriteLine ("Profil saved. You will be able to log in.\nPlease push a key to continue..."); Console.WriteLine ("******************************************"); Console.ReadKey (); Menu.HomePage (); }
public static void DeleteAccount() { Console.WriteLine ("Are you sure you want delete your account ? All your transactions and budget will be delete : (y/n)"); bool correctChoice = false; while (!correctChoice) { switch (Console.ReadLine ()) { case "y": CurrentUser.Remove (); CurrentUser = null; Console.WriteLine ("Your account was deleted. Press a key to go to the Home Page"); Console.ReadKey (); Menu.HomePage (); break; default: Console.WriteLine ("Your account was not deleted. Press a key to go to the Home Page"); Console.ReadKey (); User.HomePage (); break; } } }