Beispiel #1
0
 private void btnDangNhap_Click(object sender, EventArgs e)
 {
     getID = myNhanVienDAL.getDangNhap(txtTaiKhoan.Text, txtMatKhau.Text);
     if (getID == "")
     {
         MessageBox.Show("Sai tài khoản or mật khẩu.", "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
         txtTaiKhoan.Clear();
         txtMatKhau.Clear();
     }
     if (getID != "")
     {
         string[] arr = getID.Split('-');
         if (arr[1] == "Thủ Thư")
         {
             this.Hide();
             frmThuThu frm = new frmThuThu();
             frm.lblThuThu_frmAdmin.Text = arr[0];
             frm.ShowDialog();
             this.Show();
         }
         if (arr[1] == "Admin")
         {
             //MessageBox.Show("admin thành công");
             this.Hide();
             frmAdmin frm = new frmAdmin();
             frm.lblAdmin_frmAdmin.Text = arr[0];
             frm.ShowDialog();
             this.Show();
         }
     }
 }
        private void Form1_Load(object sender, EventArgs e)
        {
            texMaPhieuMuon.Text = maTuTang();
            texNgayMuon.Text    = ngayMuon();


            ////////////////////
            /////////
            frmThuThu fthuthu = new frmThuThu();

            texMaNhanVien.Text  = laymanv;
            texTenNhanVien.Text = myNhanVienBUL.get_tennv(texMaNhanVien.Text.ToString());
            /////////
            ////////////////////


            cboxTenTaiLieu.DataSource    = myTaiLieuBUL.getTaiLieu();
            cboxTenTaiLieu.DisplayMember = "TenTaiLieu";
            cboxTenTaiLieu.ValueMember   = "MaTaiLieu";
            texMaTaiLieu.Text            = "";
            cboxTenTaiLieu.SelectedIndex = -1;
            butDK.Enabled              = false;
            butLuu.Enabled             = false;
            butHuy.Enabled             = false;
            groupBoxTimTaiLieu.Enabled = false;
            listview1.Enabled          = false;
            dgv.Enabled = false;
            texMaDocGia.Select();
        }