private void loginToolStripMenuItem_Click(object sender, EventArgs e) { if (IsDB) { using (LoginForm login = new LoginForm()) { if (login.ShowDialog() == DialogResult.OK) { User = login.UserName; Password = login.Password; Permission = login.GetPermission(); lb_user.Text = "User: "******"Không có kết nối database. Vui lòng kiểm tra lại"); } }
public void Init() { proView = new View.ProductView(gbContent.Size); this.gbContent.Controls.Add(proView); proView.Name = "proView"; proView.InitData(); HuongdanView hdView = new HuongdanView(gbContent.Size); hdView.Name = "hdView"; this.gbContent.Controls.Add(hdView); ThanhtoanView ttView = new ThanhtoanView(); ttView.Name = "ttView"; this.gbContent.Controls.Add(ttView); DanhsachDonhangView ddView = new DanhsachDonhangView(gbContent.Size); ddView.Name = "ddView"; this.gbContent.Controls.Add(ddView); ddView.InitData(); KhacView kView = new KhacView(); kView.Name = "kView"; this.gbContent.Controls.Add(kView); UserView uView = new UserView(gbContent.Size); uView.Name = "uView"; this.gbContent.Controls.Add(uView); uView.InitData(); HoTroView htView = new HoTroView(gbContent.Size); htView.Name = "htView"; this.gbContent.Controls.Add(htView); FAQview FAQView = new FAQview(gbContent.Size); FAQView.Name = "FAQView"; this.gbContent.Controls.Add(FAQView); CollectionsView clsView = new CollectionsView(gbContent.Size); clsView.Name = "clsView"; this.gbContent.Controls.Add(clsView); setContent(EnumClass.Functions.Huongdansudung); Permission = EnumClass.PermissionUser.Unknown; }
private void logoutToolStripMenuItem_Click(object sender, EventArgs e) { User = string.Empty; Permission = EnumClass.PermissionUser.Unknown; lb_user.Text = "User: " + Permission.ToString(); logoutToolStripMenuItem.Enabled = false; loginToolStripMenuItem.Enabled = true; chagnepassToolStripMenuItem.Enabled = false; setContent(EnumClass.Functions.Huongdansudung); if (Id >= 0) { controller.endLogin(Id); Id = -1; } }
private void SetPermission(EnumClass.PermissionUser value) { permission = value; }