private void btnTimChucVu_Click_1(object sender, EventArgs e) { try { using (var k = new AppCode.QuanCafe()) { var kq = k.TimCV(txtIDChucVu.Text); if (kq == null) { MessageBox.Show("Không tìm thấy", "Thông báo ", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); return; } else { txtIDCV.Text = kq.IDChucVu; txtTenCV.Text = kq.TenChucVu; txtMoTaCV.Text = kq.MoTa; } } } catch { return; } }
private void LoadThongTinNhanVien(int vitri) { try { using (var k = new AppCode.QuanCafe()) { txtMaNV.Text = grvDSNV.Rows[vitri].Cells[1].Value.ToString().Trim(); txt2MaNV.Text = grvDSNV.Rows[vitri].Cells[1].Value.ToString().Trim(); txtTenNV.Text = grvDSNV.Rows[vitri].Cells[2].Value.ToString(); dtPk.Value = Convert.ToDateTime(grvDSNV.Rows[vitri].Cells[3].Value.ToString()); txtNoiTamTru.Text = grvDSNV.Rows[vitri].Cells[5].Value.ToString(); txtSDT.Text = grvDSNV.Rows[vitri].Cells[6].Value.ToString().Trim(); txtTenDNNV.Text = grvDSNV.Rows[vitri].Cells[7].Value.ToString(); txtMatKhauNV.Text = grvDSNV.Rows[vitri].Cells[8].Value.ToString(); cbbChucVu.Text = k.TimCV((grvDSNV.Rows[vitri].Cells[9].Value.ToString())).TenChucVu; } } catch (Exception e) { //clear text box } }