private void btnAccount_Click(object sender, EventArgs e) { fDoiMatKhau dmk = new fDoiMatKhau(); dmk.Text = this.Text; dmk.ShowDialog(); }
private void btnLuu_Click(object sender, EventArgs e) { btnThem.Enabled = true; btnSua.Enabled = true; btnXoa.Enabled = true; btnReload.Enabled = false; btnHuy.Enabled = false; if (!txtMaNV.Text.Trim().Equals("") && !txtHoten.Text.Trim().Equals("") && !cbGioitinh.Text.Trim().Equals("") && !txtChucvu.Text.Trim().Equals("") && !dtpNgaysinh.Text.Trim().Equals("") && !txtDiachi.Text.Trim().Equals("") && !txtSDT.Text.Trim().Equals("") && !txtLuong.Text.Trim().Equals("")) { if (Them) { BLNV.ThemNhanVien(this.txtMaNV.Text, this.txtHoten.Text, file, this.cbGioitinh.Text, this.txtChucvu.Text, this.dtpNgaysinh.Value.Date, this.txtDiachi.Text, this.txtSDT.Text, Convert.ToDecimal(this.txtLuong.Text)); LoadDataNhanVien(); MessageBox.Show("Đã thêm xong!"); fDoiMatKhau add = new fDoiMatKhau(); add.ShowDialog(); } else { int r = dgvNhanvien.CurrentCell.RowIndex; string strMaNV = dgvNhanvien.Rows[r].Cells[0].Value.ToString(); BLNV.SuaNhanVien(this.txtMaNV.Text, this.txtHoten.Text, file, this.cbGioitinh.Text, this.txtChucvu.Text, this.dtpNgaysinh.Value.Date, this.txtDiachi.Text, this.txtSDT.Text, Convert.ToDecimal(this.txtLuong.Text)); LoadDataNhanVien(); MessageBox.Show("Đã sửa xong!"); } } else { MessageBox.Show("Xin nhập đầy đủ thông tin!"); } }