Exemple #1
0
        private void bt_Sua_Click(object sender, EventArgs e)
        {
            Show_Hide(true);
            AccountBus acbus = new AccountBus();
            ACCOUNT    ac    = new ACCOUNT();

            ac            = acbus.ACCOUNTByName(txt_user.Text);
            txt_pass.Text = ac.PASS;
        }
 private void txt_user_Leave(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(txt_user.Text))
     {
         if (acbus.ACCOUNTByName(txt_user.Text).ID > 0)
         {
             MessageBox.Show("Tên user đã tồn tại");
             txt_user.Text = "";
         }
     }
 }
Exemple #3
0
        private void bt_enter_Click(object sender, EventArgs e)
        {
            AccountBus acBus    = new AccountBus();
            string     username = (tb_TenDangNhap.Text);
            string     pass     = tb_MatKhau.Text;

            try
            {
                if (String.IsNullOrEmpty(username))
                {
                    MessageBox.Show("Tên đăng nhập rỗng vui lòng kiểm tra lại!");
                    return;
                }
                if (String.IsNullOrEmpty(pass))
                {
                    MessageBox.Show("Password rỗng vui lòng kiểm tra lại!");
                    return;
                }

                if (acBus.checkac(username, pass) == true)
                {
                    MainMenu mainMenu = new MainMenu();
                    MainMenu.UserName = acBus.ACCOUNTByName(username).USERNAME;
                    MainMenu.usrId    = acBus.ACCOUNTByName(username).ID;
                    mainMenu.Show();

                    this.Visible = false;
                }
                else
                {
                    MessageBox.Show("Tên đăng nhập hoặc mật khẩu không đúng.Hãy kiểm tra và nhập lại!");
                    tb_MatKhau.Text = "";
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Exemple #4
0
        private void ThongTinNv_Load(object sender, EventArgs e)
        {
            int        id;
            string     name  = UserName_infor;
            AccountBus acbus = new AccountBus();
            ACCOUNT    ac    = new ACCOUNT();

            ac = acbus.ACCOUNTByName(name);
            id = ac.ID;
            NhanVienBus nvbus = new NhanVienBus();
            NHANVIEN    nv    = new NHANVIEN();

            nv            = nvbus.NhanVienByID(id);
            txt_manv.Text = nv.MANV.ToString();
            if (nv.PHAI == "Nam")
            {
                rd_nam.Checked = true;
                rd_nu.Enabled  = false;
            }
            else
            {
                rd_nu.Checked  = true;
                rd_nam.Enabled = false;
            }

            txt_CMND.Text    = nv.CMT;
            txt_DiaChi.Text  = nv.QUEQUAN;
            txt_hoten.Text   = nv.TENNV;
            txt_NgayLam.Text = nv.NGAYVAOLAM.ToString();
            DateTime d = Convert.ToDateTime(txt_NgayLam.Text);

            txt_NgayLam.Text  = d.ToString("MM/dd/yyyy");
            txt_ngaysinh.Text = nv.NGAYSINH.ToString();
            DateTime dm = Convert.ToDateTime(txt_ngaysinh.Text);

            txt_ngaysinh.Text = dm.ToString("MM/dd/yyyy");
            txt_Sdt.Text      = nv.SDT;
            txt_user.Text     = ac.USERNAME;
            Show_Hide(false);
        }
Exemple #5
0
        private void MainMenu_Load(object sender, EventArgs e)
        {
            QuanLiBanHang.Size     = new Size(645, 491);
            QuanLiBanHang.Location = new Point(202, 26);
            bt_BanHang.BackColor   = Color.FromArgb(26, 188, 156); //mau button khi nhap vao
            // chỉ hiện panel chính
            {
                QuanLiKho.Hide();
                BaoCaoDoanhSo.Hide();
                QuanLiNhanVien.Hide();
                pn_DangXuat.Hide();
                pn_ThongBao.Hide();
            }
            QuanLiBanHang.Show();
            bt_Account.Text           = UserName;
            ThongTinNv.UserName_infor = bt_Account.Text;
            int ma = ac.ACCOUNTByName(UserName).ID;

            if (nvbus.NhanVienByID(ma).MACV == "NVBH")
            {
                bt_QuanLiNhanVien.Hide();
            }
        }