Ejemplo n.º 1
0
        public void XuLyKhiDangNhapThanhCong(Control sender, clsNhanVienDangNhap nv)
        {
            //ẩn uc Đăng nhập
            this.pnlMain.Controls.Remove(sender);
            // Trạng thái đã đăng nhập thành công
            mnuMain.Enabled      = true;
            tbtnDangXuat.Enabled = true;
            ucThemNhanVien ucThemNV = new ucThemNhanVien();

            this.pnlMain.Controls.Add(ucThemNV);
            lblNguoiDung.Text = nv.Ho + " " + nv.Ten;
            LoadPhanQuyen();
            clsNhatKy_BUS BUSNK = new clsNhatKy_BUS();

            BUSNK.ThemNhatKy(Program.NhanVien_Login.TaiKhoan, DateTime.Now, "Đã đăng nhập vào hệ thống");
            //System.Drawing.Size kichthuoc = this.Size;
            //MessageBox.Show(kichthuoc.ToString());
        }
Ejemplo n.º 2
0
        private void tbtnNhanVien_Click(object sender, EventArgs e)
        {
            ucThemNhanVien ucTNV;
            ucThemNhanVien c = pnlMain.Controls.Find("ucThemNhanVien", false).FirstOrDefault() as ucThemNhanVien;

            if (c == null)
            {
                ucTNV = new ucThemNhanVien();
                pnlMain.Controls.Add(ucTNV);
            }
            else
            {
                c.Show();
            }
            foreach (Control ctrl in pnlMain.Controls)
            {
                if (ctrl.Name != "ucThemNhanVien")
                {
                    ctrl.Hide();
                }
            }
        }