} // thuoc tinh tu dong // CAU TU // Cau tu mac dinh public TaiKhoan(DSGiaoDich listGD) { this.Ten = ""; // gan bang ten mac dinh this.SoTienBanDau = 0; // [Quan he thanh phan] this.ngaymo = new ThoiGian(); // tao doi tuong ben trong lop this.KieuTK = KieuTaiKhoan.TienMat; //[Quan he ket hop voi DSGiaoDich] // doi tuong duoc tao ra ben ngoai lop // khi gan doi tuong moi thi khong xoa doi tuong cu this.listGD = listGD; }
public TaiKhoan(string ten, double sotienbandau, ThoiGian ngaymo, KieuTaiKhoan kieuTK, DSGiaoDich listGD) { this.Ten = ten; this.SoTienBanDau = sotienbandau; // [Quan he thanh phan] this.ngaymo = ngaymo; // tao doi tuong ben trong lop this.KieuTK = kieuTK; //[Quan he ket hop voi DSGiaoDich] // doi tuong duoc tao ra ben ngoai lop // khi gan doi tuong moi thi khong xoa doi tuong cu this.listGD = listGD; }
// CAC THANH PHAN STATIC // Ham tra ra ten kieu tai khoan public static string LayTenKieuTaiKhoan(KieuTaiKhoan kieuTK) { string st = "Tien mat"; switch (kieuTK) { case KieuTaiKhoan.TienMat: st = "Tien mat"; break; case KieuTaiKhoan.Sec: st = "Sec"; break; case KieuTaiKhoan.TinDung: st = "Tin dung"; break; case KieuTaiKhoan.GhiNo: st = "Ghi no"; break; case KieuTaiKhoan.DauTu: st = "Dau tu"; break; case KieuTaiKhoan.Vay: st = "Vay"; break; case KieuTaiKhoan.TietKiem: st = "Tiet kiem"; break; } return(st); }