protected override void LoadDialogExtention()
        {
            //okay lets load the spreadsheet
            //and if there are any error display them
            //else continue
            var dictionary = ImportCsvsService.LoadMappingDictionary(Request);

            var importService = new SpreadsheetImportService(XrmRecordService);
            var parseResponse = importService.ParseIntoEntities(dictionary);

            if (parseResponse.ResponseItems.Any())
            {
                AddObjectToUi(parseResponse,
                              nextAction: () =>
                {
                    RemoveObjectFromUi(parseResponse);
                    StartNextAction();
                },
                              backAction: () =>
                {
                    RemoveObjectFromUi(parseResponse);
                    MoveBackToPrevious();
                });
            }
            else
            {
                StartNextAction();
            }
        }
示例#2
0
        protected override void LoadDialogExtention()
        {
            //okay lets load the spreadsheet
            //and if there are any error display them
            //else continue
            var logController = new LogController(LoadingViewModel);
            var dictionary    = ImportCsvsService.LoadMappingDictionary(Request);

            var importService = new SpreadsheetImportService(XrmRecordService);
            var parseResponse = importService.ParseIntoEntities(dictionary, logController, useAmericanDates: Request.DateFormat == DateFormat.American);

            if (parseResponse.ResponseItems.Any())
            {
                AddObjectToUi(parseResponse
                              , cancelAction: Controller.Close
                              , nextAction: () =>
                {
                    RemoveObjectFromUi(parseResponse);
                    StartNextAction();
                }
                              , nextActionLabel: "Import"
                              , backAction: () =>
                {
                    RemoveObjectFromUi(parseResponse);
                    MoveBackToPrevious();
                });
            }
            else
            {
                StartNextAction();
            }
        }