BKI_DichVuMatDat.DanhMuc.f151_Danh_sach_nhan_vien_master.import_excel C# (CSharp) Method

import_excel() public method

public import_excel ( ) : void
return void
        public void import_excel()
        {
            //OpenFileDialog openFileDialog1 = new OpenFileDialog();

            //// Set filter options and filter index.
            //openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm";
            //openFileDialog1.Multiselect = false;
            //var userClickedOK = openFileDialog1.ShowDialog();

            //if (userClickedOK == System.Windows.Forms.DialogResult.OK)
            //{
            //    m_txt_path = openFileDialog1.FileName;
            //    F152_DANH_SACH_NHAN_VIEN_EXCEL v_f = new F152_DANH_SACH_NHAN_VIEN_EXCEL();
            //    v_f.displayToInsertExcel(m_txt_path);
            //    // WinFormControls.load_xls_to_gridview(m_txt_path, m_grc);
            //}
            //m_txt_path = WinFormControls.openFileDialog();
            //if (m_txt_path != "")
            //{
            F152_DANH_SACH_NHAN_VIEN_EXCEL v_f = new F152_DANH_SACH_NHAN_VIEN_EXCEL();
            v_f.ShowDialog();
            //}
            load_data_to_grid();
        }

Usage Example

 private void m_cmd_nhap_thong_tin_nhan_vien_Click(object sender, EventArgs e)
 {
     try
     {
         f151_Danh_sach_nhan_vien_master v_frm = new f151_Danh_sach_nhan_vien_master();
         v_frm.import_excel();
         if (chuyen_buoc_tiep_theo())
         {
             v_frm.ShowDialog();
         }
         //v_frm.Show();
         //m_e_buoc_hien_tai++;
         set_init_form_load();
     }
     catch (Exception v_e)
     {
         CSystemLog_301.ExceptionHandle(v_e);
     }
 }