public KiemTraThoiGianHopDongHopLeForInsert ( decimal ip_dc_id_nhan_vien, System.DateTime ip_dat_tu_ngay, System.DateTime ip_dat_den_ngay ) : bool | ||
ip_dc_id_nhan_vien | decimal | |
ip_dat_tu_ngay | System.DateTime | |
ip_dat_den_ngay | System.DateTime | |
return | bool |
private bool check_thoi_gian_hop_dong_Insert() { //Hợp đồng hợp lệ khi trong một khoảng thời gian chỉ có một hợp đồng US_GD_HOP_DONG v_us = new US_GD_HOP_DONG(); DateTime v_dat_den_ngay = m_dat_ngay_ket_thuc.EditValue == null ? new DateTime(2100, 01, 01).Date : m_dat_ngay_ket_thuc.DateTime.Date; return v_us.KiemTraThoiGianHopDongHopLeForInsert(Convert.ToDecimal(m_sle_chon_nhan_vien.EditValue), m_dat_ngay_bat_dau.DateTime.Date, v_dat_den_ngay); }
//private bool check_ma_hd_chua_ton_tai(DataRow ip_dr) //{ // US_GD_HOP_DONG v_us = new US_GD_HOP_DONG(); // DS_GD_HOP_DONG v_ds = new DS_GD_HOP_DONG(); // v_us.FillDataset(v_ds, "where MA_HOP_DONG = '" + ip_dr[ExcelHopDong.MA_HOP_DONG].ToString() + "'"); // if(v_ds.Tables[0].Rows.Count != 0) // { // XtraMessageBox.Show("Mã hợp đồng của nhân viên " + ip_dr[ExcelHopDong.MA_NHAN_VIEN].ToString() + " đã có trong hệ thống!", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return false; // } // return true; //} private bool check_thoi_gian_hop_dong_Insert(DataRow ip_dr) { //Hợp đồng hợp lệ khi trong một khoảng thời gian chỉ có một hợp đồng US_GD_HOP_DONG v_us = new US_GD_HOP_DONG(); var v_dc_id_nhan_vien = ExecuteFuntion.LayNhanVienID(ip_dr[ExcelHopDong.MA_NHAN_VIEN].ToString()); var v_dat_ngay_bat_dau = Convert.ToDateTime(ip_dr[ExcelHopDong.NGAY_BAT_DAU]).Date; var v_dat_ngay_ket_thuc = ip_dr[ExcelHopDong.NGAY_KET_THUC] == DBNull.Value ? new DateTime(2100, 01, 01).Date : Convert.ToDateTime(ip_dr[ExcelHopDong.NGAY_KET_THUC]); var v_bool_hop_le = v_us.KiemTraThoiGianHopDongHopLeForInsert(v_dc_id_nhan_vien, v_dat_ngay_bat_dau, v_dat_ngay_ket_thuc); if(!v_bool_hop_le) { XtraMessageBox.Show("Thời gian hợp đồng của nhân viên " + ip_dr[ExcelHopDong.MA_NHAN_VIEN].ToString() + " không hợp lệ " + "do đã có hợp đồng trong khoảng thời gian này rồi", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning); } return v_bool_hop_le; }