BKI_DichVuMatDat.US.US_GD_LUONG_CUNG.KiemTraThoiGianVoiHeSoLNSForUpdate C# (CSharp) Method

KiemTraThoiGianVoiHeSoLNSForUpdate() public method

public KiemTraThoiGianVoiHeSoLNSForUpdate ( decimal ip_dc_id_gd_luong_cung, System.DateTime ip_dat_tu_ngay, System.DateTime ip_dat_den_ngay ) : bool
ip_dc_id_gd_luong_cung decimal
ip_dat_tu_ngay System.DateTime
ip_dat_den_ngay System.DateTime
return bool
        public bool KiemTraThoiGianVoiHeSoLNSForUpdate(decimal ip_dc_id_gd_luong_cung, DateTime ip_dat_tu_ngay, DateTime ip_dat_den_ngay)
        {
            CStoredProc v_cstore = new CStoredProc("pr_LC_kiem_tra_thoi_gian_hop_le_voi_lns_ForUpdate");
            v_cstore.addDecimalInputParam("@ip_dc_id_gd_luong_cung", ip_dc_id_gd_luong_cung);
            v_cstore.addDatetimeInputParam("@ip_dat_tu_ngay", ip_dat_tu_ngay);
            v_cstore.addDatetimeInputParam("@ip_dat_den_ngay", ip_dat_den_ngay);

            SqlParameter v_yn = v_cstore.addNVarcharOutputParam("@op_str_hop_le_yn", "");
            v_cstore.ExecuteCommand(this);

            return v_yn.Value.ToString() == "Y" ? true : false;
        }

Usage Example

 private bool kiem_tra_thoi_gian_hop_le_voi_lns_Update()
 {
     US_GD_LUONG_CUNG v_us = new US_GD_LUONG_CUNG();
     var v_dat_tu_ngay = m_dat_ngay_bat_dau.DateTime.Date;
     var v_dat_den_ngay = m_dat_ngay_ket_thuc.EditValue == null ? new DateTime(2100, 1, 1).Date : m_dat_ngay_ket_thuc.DateTime.Date;
     if(!v_us.KiemTraThoiGianVoiHeSoLNSForUpdate(m_us_gd_luong_cung.dcID, v_dat_tu_ngay, v_dat_den_ngay))
     {
         XtraMessageBox.Show("Không sửa lương cứng được vì nhân viên đã có hệ số LNS có hiệu lực trong khoảng thời gian này rồi!", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return false;
     }
     return true;
 }