Пример #1
0
        /// <summary>
        /// Hàm lấy dữ liệu từ file excel
        /// </summary>
        public void Napdulieu()
        {
            try
            {
                var frmNapDuLieu = new FrmNapDuLieu(GetTable(), 1)
                {
                    ViTriHeader = 1
                };
                frmNapDuLieu.ShowDialog();
                var resultValue = frmNapDuLieu.ResultValue;
                if (resultValue == null || resultValue.Rows.Count == 0) return;
                var table = (DataTable)dgv_DanhSach.DataSource;

                table.Merge(resultValue);
                dgv_DanhSach.DataSource = table;
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains(FormResource.msgLostConnect))
                {
                    MessageBox.Show(FormResource.txtLoiDB);
                }
                else
                    Log2File.LogExceptionToFile(ex);
            }
        }
Пример #2
0
 public void Napdulieu()
 {
     try
     {
         var frmNapDuLieu = new FrmNapDuLieu(GetTable(), _idKyThi)
         {
             ViTriHeader = 1
         };
         frmNapDuLieu.ShowDialog();
         var resultValue = frmNapDuLieu.ResultValue;
         if (resultValue == null || resultValue.Rows.Count == 0) return;
         var frm = new FrmImportDapAn(resultValue);
         frm.ShowDialog();
         Huy();
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }