private bool check_phieu_is_exist()
        {
            DS_V_RPT_CHI_TIET_PHIEU_THU v_ds_v_rpt_chi_tiet_phieu_thu = new DS_V_RPT_CHI_TIET_PHIEU_THU();
            US_V_RPT_CHI_TIET_PHIEU_THU v_us_v_rpt_chi_tiet_phieu_thu = new US_V_RPT_CHI_TIET_PHIEU_THU();
            v_us_v_rpt_chi_tiet_phieu_thu.FillDataset(v_ds_v_rpt_chi_tiet_phieu_thu, CIPConvert.ToDecimal(m_cbo_lop_mon.SelectedValue), m_dat_tai_ngay.Value.Date);

            if (v_ds_v_rpt_chi_tiet_phieu_thu.Tables[0].Rows.Count == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
        private void delete_phieu_cu()
        {
            DS_V_RPT_CHI_TIET_PHIEU_THU v_ds_v_rpt_chi_tiet_phieu_thu = new DS_V_RPT_CHI_TIET_PHIEU_THU();
            US_V_RPT_CHI_TIET_PHIEU_THU v_us_v_rpt_chi_tiet_phieu_thu = new US_V_RPT_CHI_TIET_PHIEU_THU();

            v_us_v_rpt_chi_tiet_phieu_thu.FillDataset(v_ds_v_rpt_chi_tiet_phieu_thu, CIPConvert.ToDecimal(m_cbo_lop_mon.SelectedValue), m_dat_tai_ngay.Value.Date);
            for (int i = 0; i < v_ds_v_rpt_chi_tiet_phieu_thu.Tables[0].Rows.Count; i++)
            {
                US_V_RPT_CHI_TIET_PHIEU_THU v_us_v_rpt_chi_tiet_phieu_thu_detail = new US_V_RPT_CHI_TIET_PHIEU_THU(v_ds_v_rpt_chi_tiet_phieu_thu.Tables[0].Rows[i]);
                try
                {
                    v_us_v_rpt_chi_tiet_phieu_thu_detail.BeginTransaction();
                    v_us_v_rpt_chi_tiet_phieu_thu_detail.DeleteByID(v_us_v_rpt_chi_tiet_phieu_thu_detail.dcID);
                    v_us_v_rpt_chi_tiet_phieu_thu_detail.CommitTransaction();
                }
                catch (Exception v_e)
                {
                    v_us_v_rpt_chi_tiet_phieu_thu_detail.Rollback();
                    CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
                        new CDBClientDBExceptionInterpret());
                    v_objErrHandler.showErrorMessage();
                    //BaseMessages.MsgBox_Infor("Không xóa được học sinh này do học sinh này đang học một lớp môn nào đó!");
                }
            }
        }
        private void delete_phieu_cu()
        {
            DS_V_RPT_CHI_TIET_PHIEU_THU v_ds_v_rpt_chi_tiet_phieu_thu = new DS_V_RPT_CHI_TIET_PHIEU_THU();
            US_V_RPT_CHI_TIET_PHIEU_THU v_us_v_rpt_chi_tiet_phieu_thu = new US_V_RPT_CHI_TIET_PHIEU_THU();

            for (int v_i_cur_row = m_fg.Rows.Fixed; v_i_cur_row < m_fg.Rows.Count; v_i_cur_row++)
            {
                US_V_F340_LOP_MON_CUA_HS v_us_lm_hs = new US_V_F340_LOP_MON_CUA_HS();
                grid2us_object(v_us_lm_hs, v_i_cur_row);

                v_us_v_rpt_chi_tiet_phieu_thu.FillDataset(v_ds_v_rpt_chi_tiet_phieu_thu, CIPConvert.ToDecimal(v_us_lm_hs.dcID_LOP_MON), m_dat_ngay_thu.Value.Date);

                for (int i = 0; i < v_ds_v_rpt_chi_tiet_phieu_thu.Tables[0].Rows.Count; i++)
                {
                    US_V_RPT_CHI_TIET_PHIEU_THU v_us_v_rpt_chi_tiet_phieu_thu_detail = new US_V_RPT_CHI_TIET_PHIEU_THU(v_ds_v_rpt_chi_tiet_phieu_thu.Tables[0].Rows[i]);
                    v_us_v_rpt_chi_tiet_phieu_thu_detail.BeginTransaction();
                    v_us_v_rpt_chi_tiet_phieu_thu_detail.DeleteByID(v_us_v_rpt_chi_tiet_phieu_thu_detail.dcID);
                    v_us_v_rpt_chi_tiet_phieu_thu_detail.CommitTransaction();
                }
            }
        }
        private bool check_phieu_is_exist()
        {
            DS_V_RPT_CHI_TIET_PHIEU_THU v_ds_v_rpt_chi_tiet_phieu_thu = new DS_V_RPT_CHI_TIET_PHIEU_THU();
            US_V_RPT_CHI_TIET_PHIEU_THU v_us_v_rpt_chi_tiet_phieu_thu = new US_V_RPT_CHI_TIET_PHIEU_THU();

            int check_phieu_is_exist = 0;

            for (int v_i_cur_row = m_fg.Rows.Fixed; v_i_cur_row < m_fg.Rows.Count; v_i_cur_row++)
            {
                US_V_F340_LOP_MON_CUA_HS v_us_lm_hs = new US_V_F340_LOP_MON_CUA_HS();
                grid2us_object(v_us_lm_hs, v_i_cur_row);

                v_us_v_rpt_chi_tiet_phieu_thu.FillDataset_by_id_lm_id_hs(v_ds_v_rpt_chi_tiet_phieu_thu, CIPConvert.ToDecimal(v_us_lm_hs.dcID_HOC_SINH), CIPConvert.ToDecimal(v_us_lm_hs.dcID_LOP_MON), m_dat_ngay_thu.Value.Date);

                if (v_ds_v_rpt_chi_tiet_phieu_thu.Tables[0].Rows.Count != 0)
                {
                    check_phieu_is_exist = check_phieu_is_exist + 1;
                }
            }

            if (check_phieu_is_exist != 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
 private void delete_phieu_cu()
 {
     DS_V_RPT_CHI_TIET_PHIEU_THU v_ds_v_rpt_chi_tiet_phieu_thu = new DS_V_RPT_CHI_TIET_PHIEU_THU();
     US_V_RPT_CHI_TIET_PHIEU_THU v_us_v_rpt_chi_tiet_phieu_thu = new US_V_RPT_CHI_TIET_PHIEU_THU();
     v_us_v_rpt_chi_tiet_phieu_thu.FillDataset(v_ds_v_rpt_chi_tiet_phieu_thu, CIPConvert.ToDecimal(m_cbo_lop_mon.SelectedValue), m_dat_tai_ngay.Value.Date);
     for (int i = 0; i < v_ds_v_rpt_chi_tiet_phieu_thu.Tables[0].Rows.Count; i++)
     {
         US_V_RPT_CHI_TIET_PHIEU_THU v_us_v_rpt_chi_tiet_phieu_thu_detail = new US_V_RPT_CHI_TIET_PHIEU_THU(v_ds_v_rpt_chi_tiet_phieu_thu.Tables[0].Rows[i]);
         v_us_v_rpt_chi_tiet_phieu_thu_detail.BeginTransaction();
         v_us_v_rpt_chi_tiet_phieu_thu_detail.DeleteByID(v_us_v_rpt_chi_tiet_phieu_thu_detail.dcID);
         v_us_v_rpt_chi_tiet_phieu_thu_detail.CommitTransaction();
     }
 }