private void btnThem_Click_2(object sender, EventArgs e) { string tenChucVu = txtTenChucVu.Text.ToString(); float heSo = float.Parse(txtHeSoPhuCap.Text); bool kt = chucVuBUL.ThemChucVu(tenChucVu, heSo); if (kt) { MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Thêm thất bại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } this.Close(); }
private void BtnThemChucVu_Click(object sender, EventArgs e) { if (txtTenCV.Text != "") { ChucVuDTO cv = new ChucVuDTO(); cv.TenChucVu = txtTenCV.Text; cv = ChucVuBUL.ThemChucVu(cv); if (cv != null) { lstChucVu.Add(cv); ReloadDataGridView(); MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Thêm thất bại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Tên bộ phận không được để trống!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }