示例#1
0
        private void FormatData()
        {
            switch (xlueFormatType.EditValue.ToString())
            {
            case "A":
                xgcResult.DataSource = FormatterHelper.ImportData(_dtExcelData, _objectSpace);
                break;

            case "B":
                xgcResult.DataSource = FormatterHelper.ImportDataOld(_dtExcelData, _objectSpace);
                break;

            case "C":
                xgcResult.DataSource = FormatterHelper.ImportInvoiceNo(_dtExcelData, _objectSpace);
                break;

            case "D":
                xgcResult.DataSource = FormatterHelper.ImportReceiveCaseBase(_dtExcelData, _objectSpace);
                break;

            case "E":
                xgcResult.DataSource = FormatterHelper.ImportTransferCaseBase(_dtExcelData, _objectSpace);
                break;

            default:
                break;
            }
            xgvResult.BestFitColumns(true);
        }
示例#2
0
 private void xlueSheet_EditValueChanged(object sender, EventArgs e)
 {
     try
     {
         SplashScreenManager.ShowDefaultWaitForm();
         if (xlueSheet.ItemIndex >= 0)
         {
             FormatterHelper.LoadExcel(openFileDialog.FileName, xlueSheet.ItemIndex, ref _listSheetsName,
                                       ref _dtExcelData);
         }
     }
     catch (Exception exception)
     {
         XtraMessageBox.Show(exception.Message + "\r\n" + exception.StackTrace);
     }
     finally
     {
         SplashScreenManager.CloseDefaultWaitForm();
     }
 }
示例#3
0
 private void xbeExcelFile_ButtonClick(object sender, ButtonPressedEventArgs e)
 {
     try
     {
         SplashScreenManager.ShowDefaultWaitForm();
         if (openFileDialog.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         xbeExcelFile.Text = openFileDialog.FileName;
         FormatterHelper.LoadExcel(xbeExcelFile.Text, 0, ref _listSheetsName, ref _dtExcelData);
         xlueSheet.Properties.DataSource = _listSheetsName;
     }
     catch (Exception exception)
     {
         XtraMessageBox.Show(exception.Message + "\r\n" + exception.StackTrace);
     }
     finally
     {
         SplashScreenManager.CloseDefaultWaitForm();
     }
 }