public string get_thong_tin_dat(THONG_TIN_DAT e_thong_tin_dat)
    {
        string v_str_thong_tin = "";
        if (m_cbo_dia_chi.SelectedValue.Equals(CONST_QLDB.MA_TAT_CA)) return v_str_thong_tin;
        decimal v_dc_id_dat = CIPConvert.ToDecimal(m_cbo_dia_chi.SelectedValue);
        US_V_DM_DAT v_us_v_dm_dat = new US_V_DM_DAT(v_dc_id_dat);
        switch (e_thong_tin_dat)
        {
            case THONG_TIN_DAT.DT_KHUON_VIEN_DAT:
                v_str_thong_tin = CIPConvert.ToStr(v_us_v_dm_dat.dcDT_KHUON_VIEN);
                break;
            case THONG_TIN_DAT.GIA_TRI_THEO_SO_KE_TOAN:
                v_str_thong_tin = CIPConvert.ToStr(v_us_v_dm_dat.dcGT_THEO_SO_KE_TOAN);
                break;
            case THONG_TIN_DAT.HTSD_BI_LAN_CHIEM:
                v_str_thong_tin = CIPConvert.ToStr(v_us_v_dm_dat.dcDT_BI_LAN_CHIEM);
                break;
            case THONG_TIN_DAT.HTSD_BO_TRONG:
                v_str_thong_tin = CIPConvert.ToStr(v_us_v_dm_dat.dcDT_BO_TRONG);
                break;
            case THONG_TIN_DAT.HTSD_CO_SO_HDSN:
                v_str_thong_tin = CIPConvert.ToStr(v_us_v_dm_dat.dcDT_CO_SO_HOAT_DONG_SU_NGHIEP);
                break;
            case THONG_TIN_DAT.HTSD_CHO_THUE:
                v_str_thong_tin = CIPConvert.ToStr(v_us_v_dm_dat.dcDT_CHO_THUE);
                break;
            case THONG_TIN_DAT.HTSD_LAM_NHA_O:
                v_str_thong_tin = CIPConvert.ToStr(v_us_v_dm_dat.dcDT_LAM_NHA_O);
                break;
            case THONG_TIN_DAT.HTSD_LAM_TRU_SO_LAM_VIEC:
                v_str_thong_tin = CIPConvert.ToStr(v_us_v_dm_dat.dcDT_TRU_SO_LAM_VIEC);
                break;
            case THONG_TIN_DAT.HTSD_SU_DUNG_VAO_MUC_DICH_KHAC:
                v_str_thong_tin = CIPConvert.ToStr(v_us_v_dm_dat.dcDT_SU_DUNG_MUC_DICH_KHAC);
                break;

        }
        return v_str_thong_tin;
    }
 private void load_data_to_grid()
 {
     m_lbl_thong_tin_dat.Text = "DANH SÁCH ĐẤT ";
     US_V_DM_DAT v_us_v_dm_dat = new US_V_DM_DAT();
     DS_V_DM_DAT v_ds_v_dm_dat = new DS_V_DM_DAT();
     v_us_v_dm_dat.FillDataSetByKeyWord(
         m_ddl_bo_tinh.SelectedValue
         , m_ddl_don_vi_chu_quan.SelectedValue
         , m_ddl_don_vi_su_dung.SelectedValue
         , m_ddl_trang_thai_nha.SelectedValue
         , Person.get_user_name()
         , CONST_QLDB.ID_TAT_CA.ToString()
         , m_txt_tu_khoa.Text.Trim()
         , v_ds_v_dm_dat);
     string v_str_thong_tin = " (Có " + v_ds_v_dm_dat.V_DM_DAT.Rows.Count + " bản ghi)";
     m_lbl_thong_tin_dat.Text += v_str_thong_tin;
     m_grv_danh_sach_nha.DataSource = v_ds_v_dm_dat.V_DM_DAT;
     m_grv_danh_sach_nha.DataBind();
 }
 private void load_data_to_grid()
 {
     m_grv_danh_sach_dat.Visible = true;
     US_V_DM_DAT m_us_v_dat = new US_V_DM_DAT();
     DS_V_DM_DAT m_ds_v_dat = new DS_V_DM_DAT();
     US_DM_DON_VI m_us_don_vi = new US_DM_DON_VI();
     DS_DM_DON_VI m_ds_don_vi = new DS_DM_DON_VI();
     m_us_v_dat.FillDataSetByKeyWord(CIPConvert.ToStr(m_cbo_bo_tinh.SelectedValue)
                 , CIPConvert.ToStr(m_cbo_don_vi_chu_quan.SelectedValue)
                 , CIPConvert.ToStr(m_cbo_don_vi_su_dung_tai_san.SelectedValue)
                 , CIPConvert.ToStr(m_cbo_trang_thai.SelectedValue)
                 , Person.get_user_name()
                 , CIPConvert.ToStr(m_cbo_loai_hinh_don_vi.SelectedValue)
                 , CIPConvert.ToStr(m_txt_tim_kiem.Text)
                 , m_ds_v_dat);
     m_lbl_title.Text = "DANH MỤC ĐẤT";
     string v_str_thong_tin = " (Có " + m_ds_v_dat.V_DM_DAT.Rows.Count + " bản ghi)";
     m_lbl_title.Text += v_str_thong_tin;
     m_grv_danh_sach_dat.DataSource = m_ds_v_dat.V_DM_DAT;
     m_grv_danh_sach_dat.DataBind();
 }
        public void export_excel(
            eFormMode ip_form_mode
            , decimal ip_dc_id_dat
            , ref CObjExcelAssetParameters op_obj_excel_parameters)
        {
            //1. Đưa dữ liệu lên trên grid
            m_obj_trans = get_trans_object(m_fg_nha);
            m_e_form_mode = ip_form_mode;
            US_V_DM_DAT v_us_v_dm_dat;
            if (ip_dc_id_dat != CONST_QLDB.ID_TAT_CA)
            {
                v_us_v_dm_dat = new US_V_DM_DAT(ip_dc_id_dat);
            }
            else
            {
                v_us_v_dm_dat = new US_V_DM_DAT();
            }
            US_DM_DON_VI v_us_dm_don_vi;
            if (op_obj_excel_parameters.dcID_DON_VI_SU_DUNG != CONST_QLDB.ID_TAT_CA)
            {
                v_us_dm_don_vi = new US_DM_DON_VI(op_obj_excel_parameters.dcID_DON_VI_SU_DUNG);
            }
            else
            {
                v_us_dm_don_vi = new US_DM_DON_VI();
            }

            //2. Xuất dữ liệu ra file excel
            //CExcelWebReport v_obj_exe_report = new CExcelWebReport("BC-18 Bao cao danh muc tru so lam viec co so hoat dong su nghiep.xls", 21, 1);
            CExcelWebReport v_obj_exe_report = new CExcelWebReport();
            switch (m_e_form_mode)
            {
                case eFormMode.KE_KHAI:
                    load_data_2_grid(op_obj_excel_parameters, ip_dc_id_dat);
                    v_obj_exe_report = new CExcelWebReport(TEN_BAO_CAO.BCDM_TSLM_KE_KHAI, 21, 1);
                    break;
                case eFormMode.DE_NGHI_XU_LY:
                    load_data_2_grid(op_obj_excel_parameters, ip_dc_id_dat);
                    v_obj_exe_report = new CExcelWebReport(TEN_BAO_CAO.BCDM_TSLM_DE_NGHI_XU_LY, 21, 1);
                    break;
                case eFormMode.THONG_KE:
                    load_data_2_grid(op_obj_excel_parameters, ip_dc_id_dat);
                    v_obj_exe_report = new CExcelWebReport(TEN_BAO_CAO.BCDM_TSLM_THONG_KE, 21, 1);
                    break;
                default:
                    break;
            }

            // Thông tin phần đầu
            v_obj_exe_report.AddFindAndReplaceItem("<BO_TINH>", op_obj_excel_parameters.strTEN_BO_TINH);
            v_obj_exe_report.AddFindAndReplaceItem("<DON_VI_CHU_QUAN>", op_obj_excel_parameters.strTEN_DON_VI_CHU_QUAN);
            v_obj_exe_report.AddFindAndReplaceItem("<DON_VI_SU_DUNG_TAI_SAN>", op_obj_excel_parameters.strTEN_DON_VI_SU_DUNG);
            v_obj_exe_report.AddFindAndReplaceItem("<MA_DON_VI>", v_us_dm_don_vi.strMA_DON_VI);
            v_obj_exe_report.AddFindAndReplaceItem("<LOAI_HINH_DON_VI>", op_obj_excel_parameters.strLOAI_HINH_DON_VI);

            // Thông tin đất
            v_obj_exe_report.AddFindAndReplaceItem("<DIA_CHI>", v_us_v_dm_dat.strDIA_CHI);
            v_obj_exe_report.AddFindAndReplaceItem("<DT_KHUON_VIEN>", v_us_v_dm_dat.dcDT_KHUON_VIEN.ToString("#,##0.00"));
            v_obj_exe_report.AddFindAndReplaceItem("<TRU_SO_LAM_VIEC>", v_us_v_dm_dat.dcDT_TRU_SO_LAM_VIEC.ToString("#,##0.00"));
            v_obj_exe_report.AddFindAndReplaceItem("<CO_SO_HDSN>", v_us_v_dm_dat.dcDT_CO_SO_HOAT_DONG_SU_NGHIEP.ToString("#,##0.00"));
            v_obj_exe_report.AddFindAndReplaceItem("<LAM_NHA_O>", v_us_v_dm_dat.dcDT_LAM_NHA_O.ToString("#,##0.00"));
            v_obj_exe_report.AddFindAndReplaceItem("<CHO_THUE>", v_us_v_dm_dat.dcDT_CHO_THUE.ToString("#,##0.00"));
            v_obj_exe_report.AddFindAndReplaceItem("<BO_TRONG>", v_us_v_dm_dat.dcDT_BO_TRONG.ToString("#,##0.00"));
            v_obj_exe_report.AddFindAndReplaceItem("<BI_LAN_CHIEM>", v_us_v_dm_dat.dcDT_BI_LAN_CHIEM.ToString("#,##0.00"));
            v_obj_exe_report.AddFindAndReplaceItem("<KHAC>", v_us_v_dm_dat.dcDT_SU_DUNG_MUC_DICH_KHAC.ToString("#,##0.00"));
            v_obj_exe_report.AddFindAndReplaceItem("<GT_THEO_SO_KE_TOAN>", v_us_v_dm_dat.dcGT_THEO_SO_KE_TOAN.ToString("#,##0.00"));

            // Thông tin phần cuối
            //v_obj_exe_report.AddFindAndReplaceItem("<HO_SO_GIAY_TO_LIEN_QUAN>", v_us_dm_dat.strDIA_CHI);
            v_obj_exe_report.AddFindAndReplaceItem("<NGAY>", DateTime.Now.Day);
            v_obj_exe_report.AddFindAndReplaceItem("<THANG>", DateTime.Now.Month);
            v_obj_exe_report.AddFindAndReplaceItem("<NAM>", DateTime.Now.Year);

            // Thông tin bảng
            v_obj_exe_report.FindAndReplace(false);
            v_obj_exe_report.Export2ExcelWithoutFixedRows(m_fg_nha, 1, m_fg_nha.Cols.Count - 1, true);

            //3. Trả về địa chỉ file
            op_obj_excel_parameters.strFILE_NAME_RESULT = v_obj_exe_report.GetStrOutputFileNameWithPath();
        }
    private void load_data_2_grid()
    {
        m_lbl_thong_tin_dat.Text = "DANH SÁCH ĐẤT";
        US_V_DM_DAT v_us_v_dm_dat = new US_V_DM_DAT();
        DS_V_DM_DAT v_ds_v_dm_dat = new DS_V_DM_DAT();

        v_us_v_dm_dat.FillDataSetByKeyWord(
            CONST_QLDB.ID_TAT_CA.ToString()
            , CONST_QLDB.ID_TAT_CA.ToString()
            , CONST_QLDB.ID_TAT_CA.ToString()
            , CONST_QLDB.ID_TAT_CA.ToString()
            , Person.get_user_name()
            , CONST_QLDB.ID_TAT_CA.ToString()
            , m_txt_tu_khoa.Text.Trim()
            , v_ds_v_dm_dat
            );
        string v_str_thong_tin = " (Có " + v_ds_v_dm_dat.V_DM_DAT.Rows.Count + " bản ghi)";
        m_lbl_thong_tin_dat.Text += v_str_thong_tin;
        m_grv_danh_sach_nha.DataSource = v_ds_v_dm_dat.V_DM_DAT;
        m_grv_danh_sach_nha.DataBind();
    }