public Form1(string maTN) { InitializeComponent(); thungan = new DTO_ThuNgan(maTN, busTN.getTenThuNgan(maTN)); barStaticItem.Caption = "Xin chào " + thungan.HOTEN; ttGUI = new ThanhToanGUI(thungan); container.Controls.Add(ttGUI); ttGUI.Dock = DockStyle.Fill; vcGUI = new VaccineGUI(); container.Controls.Add(vcGUI); vcGUI.Dock = DockStyle.Fill; ptGUI = new PhieuTiemGUI(); container.Controls.Add(ptGUI); ptGUI.Dock = DockStyle.Fill; container.Controls.Add(LichSuGUI.Instance); LichSuGUI.Instance.Dock = DockStyle.Fill; container.Controls.Add(ThongKeGUI.Instance); ThongKeGUI.Instance.Dock = DockStyle.Fill; container.Controls.Add(HomeGUI.Instance); HomeGUI.Instance.Dock = DockStyle.Fill; }
public Form1(string username) { InitializeComponent(); if (username.Contains("TN")) { acBacSi.Visible = false; acAdmin.Visible = false; acKhachHang.Visible = false; DTO_ThuNgan thungan = new DTO_ThuNgan(username, busTN.getTenThuNgan(username)); barStaticItem.Caption = "Thu ngân"; ptGUI = new PhieuTiemGUI(); container.Controls.Add(ptGUI); ptGUI.Dock = DockStyle.Fill; ttGUI = new ThanhToanGUI(thungan); container.Controls.Add(ttGUI); ttGUI.Dock = DockStyle.Fill; vcGUI = new VaccineGUI(); container.Controls.Add(vcGUI); vcGUI.Dock = DockStyle.Fill; container.Controls.Add(LichSuGUI.Instance); LichSuGUI.Instance.Dock = DockStyle.Fill; } else if (username.Contains("BS")) { acThuNgan.Visible = false; acAdmin.Visible = false; acKhachHang.Visible = false; barStaticItem.Caption = "Bác sĩ"; tiemGUI = new TiemGUI(); container.Controls.Add(tiemGUI); tiemGUI.Dock = DockStyle.Fill; vcGUI = new VaccineGUI(); container.Controls.Add(vcGUI); vcGUI.Dock = DockStyle.Fill; container.Controls.Add(LichSuGUI.Instance); LichSuGUI.Instance.Dock = DockStyle.Fill; } else if (username.ToLower() == "admin") { acThuNgan.Visible = false; acBacSi.Visible = false; acKhachHang.Visible = false; barStaticItem.Caption = "Quản trị viên"; container.Controls.Add(ThongKeGUI.Instance); ThongKeGUI.Instance.Dock = DockStyle.Fill; adminTKGUI = new AD_QLTaiKhoan(); adminVCGUI = new AD_QLVaccine(); container.Controls.Add(adminTKGUI); container.Controls.Add(adminVCGUI); adminTKGUI.Dock = DockStyle.Fill; adminVCGUI.Dock = DockStyle.Fill; } else { acThuNgan.Visible = false; acBacSi.Visible = false; acAdmin.Visible = false; barStaticItem.Caption = "Khách"; vcGUI = new VaccineGUI(); container.Controls.Add(vcGUI); vcGUI.Dock = DockStyle.Fill; container.Controls.Add(LichSuGUI.Instance); LichSuGUI.Instance.Dock = DockStyle.Fill; } user = username; container.Controls.Add(HomeGUI.Instance); HomeGUI.Instance.Dock = DockStyle.Fill; }