private bool check_validate_data(decimal ip_id_don_vi)
{
if (check_ct_dang_su_dung(ip_id_don_vi))
{
string v_str_error = "Hiện có nhân viên đang công tác tại đơn vị này. Không thể xóa!";
XtraMessageBox.Show(v_str_error, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
else if (check_hd_dang_su_dung(ip_id_don_vi))
{
string v_str_error = "Hiện có nhân viên đang có hợp đồng tại đơn vị này. Không thể xóa!";
XtraMessageBox.Show(v_str_error, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
else if (check_cv_dang_su_dung(ip_id_don_vi))
{
string v_str_error = "Hiện có chức vụ đang thuộc đơn vị này. Không thể xóa!";
XtraMessageBox.Show(v_str_error, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
return true;
}