public void Detail_akun() { Akun data = Data_Akun[Login_status]; Console.WriteLine("Detail Akun\nNama : {0}", data.Ambil_data(1)); Console.WriteLine("Email : {0}", data.Ambil_data(3)); Console.WriteLine("Pin : {0}", data.Ambil_data(4)); Console.WriteLine("Saldo : {0}", data.Ambil_saldo()); Console.WriteLine("Tabungan : {0}\nPress any key to exit", data.Ambil_tabungan()); Console.ReadKey(); }
public string Recover_Password(string email) { for (int i = 0; i < Data_Akun.Count; i++) { Akun data = Data_Akun[i]; if (data.Ambil_data(3) == email) { ubah_password_akun = i; return(data.Ambil_data(2)); } } return(""); }
public void Transfer(string Username, string pin, long saldo) { Akun data = Data_Akun[Login_status]; if (Username == null) { for (int i = 0; i < Data_Akun.Count; i++) { Akun tempo = Data_Akun[i]; if (tempo.Ambil_data(4) == pin) { if (data.Ubah_data(1, null, saldo)) { tempo.Ubah_data(3, null, saldo); Console.Write("Saldo berhasil ditransfer\nPress any key to exit"); Console.ReadKey(); return; } else { Console.Write("Saldo kurang, sisa saldo {0}\nPress any key to exit", tempo.Ambil_saldo()); Console.ReadKey(); return; } } } Console.Write("Pin tak ditemukan\nPress any key to exit\n"); Console.ReadKey(); } else { for (int i = 0; i < Data_Akun.Count; i++) { Akun tempo = Data_Akun[i]; if (tempo.Ambil_data(1) == Username) { if (data.Ubah_data(1, null, saldo)) { tempo.Ubah_data(3, null, saldo); Console.Write("Saldo berhasil ditransfer\nPress any key to exit"); Console.ReadKey(); return; } else { Console.Write("Saldo kurang, sisa saldo {0}\nPress any key to exit", tempo.Ambil_saldo()); Console.ReadKey(); return; } } } Console.Write("Username tak ditemukan\nPress any key to exit\n"); Console.ReadKey(); } }
public bool Login(string username, string password) { for (int i = 0; i < Data_Akun.Count; i++) { Akun login = Data_Akun[i]; if (login.Ambil_data(1) == username && login.Ambil_data(2) == password) { Login_status = i; break; } } if (Login_status == -999) { return(false); } else { return(true); } }
public bool check_email(string email) { for (int i = 0; i < Data_Akun.Count; i++) { Akun data = Data_Akun[i]; if (data.Ambil_data(3) == email) { return(false); } } return(true); }