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 void ubah_password(string password) { Akun data = Data_Akun[ubah_password_akun]; data.Ubah_data(2, password, -1); ubah_password_akun = -999; }
public void Proses_saldo(int pilihan, long saldo) { Akun data = Data_Akun[Login_status]; switch (pilihan) { case 1: //menambah jumlah saldo if (data.Ubah_data(3, null, saldo)) { Console.Write("\nSaldo berhasil ditambahkan\nPress any key to exit\n"); Console.ReadKey(); } break; case 2: //menambah isi tabungan if (data.Ubah_data(2, null, saldo)) { Console.Write("\nTabungan berhasil ditambahkan\nPress any key to exit\n"); Console.ReadKey(); } else { Console.Write("Saldo tak cukup, jumlah saldo {0}\nPress any key to exit\n", data.Ambil_saldo()); Console.ReadKey(); } break; case 3: //tarik saldo if (data.Ubah_data(1, null, saldo)) { Console.Write("\nUang senilai {0} berhasil ditarik, sisa saldo {1}\nPress any key to exit\n", saldo, data.Ambil_saldo()); Console.ReadKey(); } else { Console.Write("\nSaldo kurang, sisa saldo {0}\npress any key to exit\n", data.Ambil_saldo()); Console.ReadKey(); } break; case 4: //tarik tabungan ke saldo if (data.Tabungan(1, saldo)) { Console.Write("\nSaldo senilai {0} berhasil ditarik dari tabungan, sisa tabungan {1}\npress any key to exit\n", saldo, data.Ambil_tabungan()); Console.ReadKey(); } else { Console.Write("\nTabungan kurang, sisa tabungan {0}\nPress any key to exit\n", data.Ambil_tabungan()); Console.ReadKey(); } break; } }