コード例 #1
0
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            _NVBLL = new NhanVienBLL();
            string mk = txtMatkhau.Text.ToUpper().Trim()+txtTaikhoan.Text.ToUpper().Trim();
            string strPassWord = _NVBLL.MaHoaSHA1(mk);
            //MessageBox.Show(strPassWord.ToString()+");
            bool kt;
            kt=_NVBLL.KiemTraUserName(txtTaikhoan.Text.Trim(),strPassWord);
            if (kt == true)
            {
                string strLoaiNV;
                strLoaiNV= _NVBLL.KiemTraAdmin(txtTaikhoan.Text.Trim(), strPassWord);
                if (strLoaiNV.Equals("Admin"))
                {
                    this.Hide();
                    frmQuanly frmql = new frmQuanly();

                    frmql.Show();
                }
                else
                {
                    _TaiKhoan = txtTaikhoan.Text.Trim();
                    this.Hide();
                    frmBanHang frmbh = new frmBanHang(_TaiKhoan);
                    frmbh.Show();
                }
            }
            else
            {
                MessageBox.Show("Tài khoản hoặc mật khẩu không đúng!");
            }
        }
コード例 #2
0
        void addFormBanHang()
        {
            frmBanHang frm = new frmBanHang();

            frm.TopLevel = false;
            tabBanHang.Controls.Add(frm);
            frm.Show();
        }
コード例 #3
0
        private void frmMain1_Load(object sender, EventArgs e)
        {
            frmBanHang frmBanHang = new frmBanHang();

            frmBanHang.TopLevel = false;
            panelMain.Controls.Clear();
            panelMain.Controls.Add(frmBanHang);
            frmBanHang.Show();
        }
コード例 #4
0
        private void banHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmBanHang banhang = new frmBanHang();

            banhang.MdiParent = this;
            banhang.Dock      = DockStyle.Fill;
            banhang.Show();
        }
コード例 #5
0
        private void btnBanHang_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;

            changecolorButtonMenu(btn);
            frmBanHang frmBanHang = new frmBanHang();

            frmBanHang.TopLevel = false;
            panelMain.Controls.Clear();
            panelMain.Controls.Add(frmBanHang);
            frmBanHang.Show();
        }
コード例 #6
0
        private void btnBanHang_ItemClick(object sender, ItemClickEventArgs e)
        {
            Form frm = KiemTraTonTai(typeof(frmBanHang));

            if (frm != null)
            {
                frm.Activate();
            }
            else
            {
                frmBanHang f = new frmBanHang();
                f.MdiParent = this;
                f.Show();
            }
        }
コード例 #7
0
        private void itemBanHang_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Form frm = KiemTraTonTai(typeof(frmBanHang));

            if (frm != null)
            {
                frm.Activate();
            }
            else
            {
                frmBanHang f = new frmBanHang();
                f.MdiParent = this;
                f.Show();
            }
        }