public frmBanDoc() { InitializeComponent(); txtNguoiLap.Enabled = false; bdBUS bd = new bdBUS(); grvBanDoc.DataSource = bd.getData(); grvBanDoc.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; disable(); btnLuu.Enabled = false; }
private void btnTim_Click(object sender, EventArgs e) { bdBUS bdB = new bdBUS(); nvBUS nvB = new nvBUS(); BanDoc bd = bdB.searchBD(txtMaSo.Text); txtMaSo.Text = bd.Id; txtTenBD.Text = bd.Name; txtDiaChi.Text = bd.Address; txtCMND.Text = bd.Cmnd; txtNgaySinh.Text = bd.Ngaysinh; txtEmail.Text = bd.Email; txtNgayLap.Text = bd.Ngaylap; txtNguoiLap.Text = nvB.getFullNamebyID(bd.Nguoilap).TenNV; }
private void btnLuu_Click(object sender, EventArgs e) { nvBUS nvB = new nvBUS(); bdBUS bdB = new bdBUS(); string IdNguoiLap = nvB.getIDbyUsername(Form1.username).IdNV; BanDoc bd = new BanDoc(txtMaSo.Text, txtTenBD.Text, txtDiaChi.Text, txtCMND.Text, txtNgaySinh.Text, txtEmail.Text, txtNgayLap.Text, IdNguoiLap); if (check == true) { bdB.addBD(bd); } else { bdB.editBD(bd); disable(); } grvBanDoc.DataSource = bdB.getData(); }