private bool check_validate_data()
{
DateTime v = m_dat_ngay_ket_thuc.DateTime;
if (m_sle_chon_nhan_vien.EditValue == null)
{
CHRM_BaseMessages.MsgBox_Error(CONST_ID_MSGBOX.ERROR_CHUA_CHON_NHAN_VIEN);
return false;
}
else if (m_txt_so_tien.Text.Trim() == "")
{
string v_str_error = "Bạn chưa nhập số tiền lương cứng!";
XtraMessageBox.Show(v_str_error, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
else if (m_dat_ngay_bat_dau.EditValue == null)
{
string v_str_error = "Bạn chưa nhập ngày bắt đầu!";
XtraMessageBox.Show(v_str_error, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
else if (m_dat_ngay_ket_thuc.DateTime != DateTime.MinValue && m_dat_ngay_bat_dau.DateTime >= m_dat_ngay_ket_thuc.DateTime)
{
string v_str_error = "Ngày kết thúc phải lớn hơn ngày bắt đầu!";
XtraMessageBox.Show(v_str_error, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
switch(m_e_form_mode)
{
case DataEntryFormMode.InsertDataState:
if(!kiem_tra_thoi_gian_hop_le_voi_lns_Insert())
{
return false;
}
break;
case DataEntryFormMode.UpdateDataState:
if(!kiem_tra_thoi_gian_hop_le_voi_lns_Update())
{
return false;
}
break;
}
return true;
}