Example #1
0
 public static AggregationAgentForge Make(
     int streamNum,
     ExprNode optionalFilter,
     ImportService importService,
     bool isFireAndForget,
     string statementName)
 {
     ExprForge evaluator = optionalFilter == null ? null : optionalFilter.Forge;
     if (streamNum == 0) {
         if (optionalFilter == null) {
             return AggregationAgentDefault.INSTANCE;
         }
         else {
             return new AggregationAgentDefaultWFilterForge(evaluator);
         }
     }
     else {
         if (optionalFilter == null) {
             return new AggregationAgentRewriteStreamForge(streamNum);
         }
         else {
             return new AggregationAgentRewriteStreamWFilterForge(streamNum, evaluator);
         }
     }
 }
        public static void QueryPlanLogOnExpr(
            bool queryPlanLogging,
            ILog queryPlanLog,
            SubordinateWMatchExprQueryPlanForge strategy,
            Attribute[] annotations,
            ImportService importService)
        {
            QueryPlanIndexHook hook = QueryPlanIndexHookUtil.GetHook(annotations, importService);
            if (queryPlanLogging && (queryPlanLog.IsInfoEnabled || hook != null)) {
                var prefix = "On-Expr ";
                queryPlanLog.Info(prefix + "strategy " + strategy.Strategy.ToQueryPlan());
                if (strategy.Indexes == null) {
                    queryPlanLog.Info(prefix + "full table scan");
                }
                else {
                    for (var i = 0; i < strategy.Indexes.Length; i++) {
                        string indexName = strategy.Indexes[i].IndexName;
                        var indexText = indexName != null ? "index " + indexName + " " : "(implicit) (" + i + ")";
                        queryPlanLog.Info(prefix + indexText);
                    }
                }

                if (hook != null) {
                    var pairs = GetPairs(strategy.Indexes);
                    SubordTableLookupStrategyFactoryForge inner = strategy.Strategy.OptionalInnerStrategy;
                    hook.InfraOnExpr(
                        new QueryPlanIndexDescOnExpr(
                            pairs,
                            strategy.Strategy.GetType().GetSimpleName(),
                            inner == null ? null : inner.GetType().GetSimpleName()));
                }
            }
        }
        public static void QueryPlanLogOnSubq(
            bool queryPlanLogging,
            ILog queryPlanLog,
            SubordinateQueryPlanDescForge plan,
            int subqueryNum,
            Attribute[] annotations,
            ImportService importService)
        {
            QueryPlanIndexHook hook = QueryPlanIndexHookUtil.GetHook(annotations, importService);
            if (queryPlanLogging && (queryPlanLog.IsInfoEnabled || hook != null)) {
                var prefix = "Subquery " + subqueryNum + " ";
                var strategy = plan == null || plan.LookupStrategyFactory == null
                    ? "table scan"
                    : plan.LookupStrategyFactory.ToQueryPlan();
                queryPlanLog.Info(prefix + "strategy " + strategy);
                if (plan?.IndexDescs != null) {
                    for (var i = 0; i < plan.IndexDescs.Length; i++) {
                        var indexName = plan.IndexDescs[i].IndexName;
                        var indexText = indexName != null ? "index " + indexName + " " : "(implicit) ";
                        queryPlanLog.Info(prefix + "shared index");
                        queryPlanLog.Info(prefix + indexText);
                    }
                }

                if (hook != null) {
                    var pairs = plan == null ? new IndexNameAndDescPair[0] : GetPairs(plan.IndexDescs);
                    var factory = plan?.LookupStrategyFactory.GetType().GetSimpleName();
                    hook.Subquery(new QueryPlanIndexDescSubquery(pairs, subqueryNum, factory));
                }
            }
        }
Example #4
0
        static void Main(string[] args)
        {
            var importService = new ImportService();
            var emps          = importService.ImportEmployees("./data.json");

            var reportingService = new ReportingService();

            // Question 1
            var employeesWhoLikePineapple = reportingService.EmployeesWhoLikePineApple(emps);

            Console.Out.WriteLine($"{employeesWhoLikePineapple.First().Key} really likes pineapple");
            Console.Out.WriteLine();



            // Question 2
            var(engineerCount, pieCount) = reportingService.PizzaCountForDepartment(emps, "Engineering");
            Console.Out.WriteLine($"You're going to need {pieCount} pizzas to feed your {engineerCount} engineers.");
            Console.Out.WriteLine();

            // Question 3
            var groupedFavorites = reportingService.FavoritesByDepartment(emps);

            foreach (var g in groupedFavorites.Keys)
            {
                Console.Out.WriteLine($"{g} likes {string.Join(", ", groupedFavorites[g].Item1)} a lot ({groupedFavorites[g].Item2} times!)");
            }
        }
Example #5
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                context.Response.ContentType = "text/plain";

                EARuleService svr       = new EARuleService();
                ImportService dsvr      = new ImportService();
                var           pageSize  = context.Request.Form.Get("pagesize");
                var           pageIndex = context.Request.Form.Get("page");
                var           type      = context.Request.Form.Get("flag");
                var           startDate = context.Request.Form.Get("start");
                var           endDate   = context.Request.Form.Get("end");

                var order = "";
                if (!string.IsNullOrEmpty(context.Request.Form.Get("sortname")))
                {
                    order = " order by " + context.Request.Form.Get("sortname") + " " + context.Request.Form.Get("sortorder");
                }
                var ruleID = context.Request.Form.Get("id");

                var model = svr.GetRuleInfo(ruleID);

                var data = dsvr.GetDataList(model, type, order, int.Parse(pageIndex), int.Parse(pageSize), startDate, endDate);
                IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
                timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(data, Formatting.Indented, timeFormat));
            }
            catch (Exception ex)
            {
                context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(new { res = false, msg = ex.Message }));
            }
        }
Example #6
0
        public void ShowImportReferences()
        {
            User.CheckPermission(PermissionCategory.IMPORT_REFERENCES, PERMISSION_MASK.ALLOW, "You do not have sufficient privileges to import references into BioLink!");

            if (_importReferencesWizard == null)
            {
                var context = new ImportWizardContext();

                Func <List <FieldDescriptor> > fieldSource = () => {
                    var service = new ImportService(User);
                    return(service.GetReferenceImportFields());
                };

                Func <ImportProcessor> importProcessorFactory = () => {
                    return(new ImportReferencesProcessor());
                };

                _importReferencesWizard = new ImportWizard(User, "Import References", context, new ImportFilterSelection(), new ImportMappingPage(fieldSource), new ImportPage(importProcessorFactory));

                _importReferencesWizard.Closed += new EventHandler((sender, e) => {
                    _importReferencesWizard = null;
                });
            }

            _importReferencesWizard.Show();
            _importReferencesWizard.Focus();
        }
Example #7
0
        private void ProcessRefresh()
        {
            ImportService newsvr = new ImportService();
            var           result = newsvr.GetDBData(CurrentRule);

            ExecScript("ImportController.setData('" + JSON.SerializeObject(result) + "')");
        }
        protected async Task HandleValidSubmit()
        {
            Pending = true;
            await ImportService.ImportCompetitionFromFIFA(ImportCompetition);

            Pending = false;
        }
Example #9
0
        static void Main(string[] args)
        {
            AskInformation(ref appId, "Please provide your application id or EXIT:");
            AskInformation(ref appKey, "Please provide your application key or EXIT:");
            AskInformation(ref appVersion, "Please provide your app version or EXIT:");
            AskInformation(ref filePath, "Please provide your csv file path or EXIT:");


            var importService = new ImportService(appId, appKey, appVersion);
            var list          = new List <Tuple <string, string> >();

            using (var reader = new StreamReader(filePath))
            {
                reader.ReadLine();
                string line = null;
                while ((line = reader.ReadLine()) != null)
                {
                    var data = line.Split(";");
                    if (data.Length >= 2)
                    {
                        list.Add(new Tuple <string, string>(data[0], data[1]));
                    }
                }
            }

            var result = importService.ImportExamples(list).Result;

            System.Console.WriteLine("Process Complete.");
            System.Console.ReadKey();
        }
Example #10
0
 public Import(ImportService importService)
 {
     InitializeComponent();
     _importService                   = importService;
     ProgressBar.DataContext          = ProgressBarData;
     bannerAlreadyImported.Visibility = bannerCanImport.Visibility = bannerInvalidDirectory.Visibility = Visibility.Hidden;
 }
Example #11
0
    /// <summary>
    /// Gets the import manager.
    /// </summary>we
    /// <returns></returns>
    private ImportManager GetImportManager()
    {
        ImportManager importManager = Page.Session["importManager"] as ImportManager;

        if (importManager != null)
        {
            if (importProcessId.Value != importManager.ToString() && String.IsNullOrEmpty(txtImportFile.Value))
            {
                lblFileRequired.Visible = false;
                lblRequiredMsg.Visible  = false;
                importManager           = null;
            }
        }
        if (importManager == null)
        {
            try
            {
                LeadDuplicateProvider duplicateProvider = new LeadDuplicateProvider();
                txtCreateGroupName.Text = DateTime.Now.ToString();
                ImportService importService = new ImportService();
                importManager = importService.CreateImportManager(typeof(ILead));
                importManager.DuplicateProvider = duplicateProvider;
                importManager.MergeProvider     = new ImportLeadMergeProvider();
                importManager.ActionManager     = GetActionManager();
            }
            catch (Exception e)
            {
                divError.Style.Add(HtmlTextWriterStyle.Display, "inline");
                divMainContent.Style.Add(HtmlTextWriterStyle.Display, "none");
                lblError.Text = (e.Message);
                (Parent.Parent.FindControl("StartNavigationTemplateContainerID").FindControl("cmdStartButton")).Visible = false;
            }
        }
        return(importManager);
    }
Example #12
0
        public static ModuleProviderResult Analyze(
            EPCompiled compiled,
            ImportService importService)
        {
            var resourceClassName = compiled.Manifest.ModuleProviderClassName;

            // load module resource class
            Type clazz;

            try {
                clazz = TypeHelper.ResolveType(resourceClassName, true);
            }
            catch (Exception e) {
                throw new EPException(e);
            }

            // instantiate
            ModuleProvider moduleResource;

            try {
                moduleResource = (ModuleProvider)TypeHelper.Instantiate(clazz);
            }
            catch (EPException) {
                throw;
            }
            catch (Exception e) {
                throw new EPException(e);
            }

            return(new ModuleProviderResult(moduleResource));
        }
        static void Main()
        {
            //userAuthenticate = System.Security.Principal.WindowsIdentity.GetCurrent().IsAuthenticated;

            if (IsAdministrator())
            {
                if (ControllerClass.PathConnectorVerify())
                {
                    if (ImportService.InstallImportVerify())
                    {
                        Application.EnableVisualStyles();
                        Application.SetCompatibleTextRenderingDefault(false);
                        Application.Run(new StartPage());
                    }
                    else
                    {
                        Application.Exit();
                    }
                }
                else
                {
                    MessageBox.Show("Connector service não está instalado!" + " Não é possível prosseguir.", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            else
            {
                MessageBox.Show("O usuário da sessão atual não possui direitos de administrador para realizar a instalação." +
                                " Não é possível prosseguir.", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Error);

                Application.Exit();
            }
        }
Example #14
0
 public EventTypeCollectorImpl(
     IContainer container,
     IDictionary<string, EventType> moduleEventTypes,
     BeanEventTypeFactory beanEventTypeFactory,
     ClassLoader classLoader,
     EventTypeFactory eventTypeFactory,
     BeanEventTypeStemService beanEventTypeStemService,
     EventTypeNameResolver eventTypeNameResolver,
     XMLFragmentEventTypeFactory xmlFragmentEventTypeFactory,
     EventTypeAvroHandler eventTypeAvroHandler,
     EventBeanTypedEventFactory eventBeanTypedEventFactory,
     ImportService importService)
 {
     _container = container;
     _moduleEventTypes = moduleEventTypes;
     _beanEventTypeFactory = beanEventTypeFactory;
     _classLoader = classLoader;
     _eventTypeFactory = eventTypeFactory;
     _beanEventTypeStemService = beanEventTypeStemService;
     _eventTypeNameResolver = eventTypeNameResolver;
     _xmlFragmentEventTypeFactory = xmlFragmentEventTypeFactory;
     _eventTypeAvroHandler = eventTypeAvroHandler;
     _eventBeanTypedEventFactory = eventBeanTypedEventFactory;
     _importService = importService;
 }
Example #15
0
        private IActionResult ImportDatas()
        {
            ImportService importService = new ImportService();

            importService.SaveToDb();
            return(Content("Imports done"));
        }
        public ImportModel(SDSComContext _db, IMemoryCache _cache)
        {
            db    = _db;
            cache = _cache;

            iSvc = new ImportService(db, cache);
        }
Example #17
0
        public async Task Purchase_Import_IncludeTax()
        {
            //预计到货日期 日期格式 有问题
            var fileUrl2  = Path.Combine(CurrentDir, "Resources/Purchase", "采购订单导入模板_含税单价2.xlsx");
            var workbook2 = await ImportService.ImportAsync <ImportPurchaseOrderIncludeTax>(new ImportOptions()
            {
                FileUrl                  = fileUrl2,
                SheetIndex               = 0,
                DataRowIndex             = 1,
                HeaderRowIndex           = 0,
                EnabledEmptyLine         = false,
                IgnoreEmptyLineAfterData = true,
            });

            var result2 = workbook2.GetResult <ImportPurchaseOrderIncludeTax>();

            Output.WriteLine(result2.ToJson());

            var fileUrl  = Path.Combine(CurrentDir, "Resources/Purchase", "采购订单导入模板_含税单价.xlsx");
            var workbook = await ImportService.ImportAsync <ImportPurchaseOrderIncludeTax>(new ImportOptions()
            {
                FileUrl                  = fileUrl,
                SheetIndex               = 0,
                DataRowIndex             = 1,
                HeaderRowIndex           = 0,
                EnabledEmptyLine         = false,
                IgnoreEmptyLineAfterData = true,
            });

            var result = workbook.GetResult <ImportPurchaseOrderIncludeTax>();

            Output.WriteLine(result.ToJson());
        }
Example #18
0
 public async Task Issue7_Import_EmptyLine()
 {
     var fileUrl = Path.Combine(CurrentDir, "Resources/Bugs", "issue7.xlsx");
     await Assert.ThrowsAsync <OfficeEmptyLineException>(async() =>
     {
         try
         {
             var workbook = await ImportService.ImportAsync <Issue7>(new ImportOptions()
             {
                 FileUrl          = fileUrl,
                 SheetIndex       = 1,
                 DataRowIndex     = 3,
                 HeaderRowIndex   = 2,
                 EnabledEmptyLine = true
             });
             var result = workbook.GetResult <Issue7>();
             Output.WriteLine(result.ToJson());
         }
         catch (OfficeEmptyLineException e)
         {
             Output.WriteLine(e.ToJson());
             throw;
         }
     });
 }
Example #19
0
        /// <summary>
        /// Ctor.
        /// </summary>
        /// <param name="jsonEventType">target type</param>
        /// <param name="service">factory for events</param>
        /// <param name="properties">written properties</param>
        /// <param name="classpathImportService">for resolving write methods</param>
        /// <throws>EventBeanManufactureException if the write method lookup fail</throws>
        public EventBeanManufacturerJsonProvided(
            JsonEventType jsonEventType,
            EventBeanTypedEventFactory service,
            WriteablePropertyDescriptor[] properties,
            ImportService classpathImportService)
        {
            this._jsonEventType = jsonEventType;
            this._service       = service;

            _beanInstantiator = new BeanInstantiatorForgeByNewInstanceReflection(jsonEventType.UnderlyingType);

            _writeFieldsReflection = new FieldInfo[properties.Length];
            var primitiveTypeCheck = false;

            _primitiveType = new bool[properties.Length];
            for (var i = 0; i < properties.Length; i++)
            {
                var propertyName = properties[i].PropertyName;
                var field        = jsonEventType.Detail.FieldDescriptors.Get(propertyName);
                _writeFieldsReflection[i] = field.OptionalField;
                _primitiveType[i]         = properties[i].PropertyType.IsPrimitive;
                primitiveTypeCheck       |= _primitiveType[i];
            }

            _hasPrimitiveTypes = primitiveTypeCheck;
        }
Example #20
0
        public async Task Issue3_ExceptionConvertError()
        {
            var fileUrl  = Path.Combine(CurrentDir, "Resources/Bugs", "issue3.xlsx");
            var workbook = await ImportService.ImportAsync <Issue3>(new ImportOptions()
            {
                FileUrl        = fileUrl,
                SheetIndex     = 0,
                DataRowIndex   = 3,
                HeaderRowIndex = 2,
            });

            Assert.Throws <OfficeDataConvertException>(() =>
            {
                try
                {
                    var result = workbook.GetResult <Issue3>();
                }
                catch (OfficeDataConvertException e)
                {
                    Assert.Equal(5, e.RowIndex);
                    Assert.Equal(2, e.ColumnIndex);
                    Assert.Equal("调拨数量", e.Name);
                    Output.WriteLine(e.ToJson());
                    throw;
                }
            });
        }
        public static void BuildOATypes(
            EventTypeRepositoryImpl repo,
            IDictionary<string, ConfigurationCommonEventTypeObjectArray> objectArrayTypeConfigurations,
            IDictionary<string, IDictionary<string, object>> nestableObjectArrayNames,
            BeanEventTypeFactory beanEventTypeFactory,
            ImportService importService)
        {
            var creationOrder = EventTypeRepositoryUtil.GetCreationOrder(
                EmptySet<string>.Instance,
                nestableObjectArrayNames.Keys,
                objectArrayTypeConfigurations);

            foreach (var objectArrayName in creationOrder) {
                if (repo.GetTypeByName(objectArrayName) != null) {
                    continue;
                }

                var objectArrayConfig = objectArrayTypeConfigurations.Get(objectArrayName);
                var propertyTypes = nestableObjectArrayNames.Get(objectArrayName);
                propertyTypes = ResolveClassesForStringPropertyTypes(propertyTypes, importService);
                var propertyTypesCompiled = EventTypeUtility.CompileMapTypeProperties(propertyTypes, repo);

                AddNestableObjectArrayType(objectArrayName, propertyTypesCompiled, objectArrayConfig, beanEventTypeFactory, repo);
            }
        }
Example #22
0
        public HttpResponseMessage Import()
        {
            try
            {
                if (HttpContext.Current.Request.Files.Count > 0)
                {
                    var file     = HttpContext.Current.Request.Files[0];
                    var fileName = Path.GetFileName(file.FileName);

                    ImportService <Product> imptService = new ImportService <Product>();
                    imptService.ValidateItems(file);

                    if (imptService._validRows.Count > 0)
                    {
                        foreach (var item in imptService._validRows)
                        {
                            _unitOfWork.ProductRepository.Insert(item);
                        }

                        _unitOfWork.Save();
                    }


                    return(Request.CreateResponse(HttpStatusCode.OK, "Imported " + imptService._validRows.Count() + " rows with " + imptService._invalidRows.Count() + " invalid rows"));
                }
                else
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest, "No file found."));
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message));
            }
        }
Example #23
0
 public SelectExprProcessor GetSelectExprProcessor(
     ImportService classpathImportService,
     bool isFireAndForget,
     string statementName)
 {
     return this;
 }
        private static Type ResolveClassForTypeName(
            string type,
            ImportService importService)
        {
            var isArray = false;
            if (type != null && EventTypeUtility.IsPropertyArray(type)) {
                isArray = true;
                type = EventTypeUtility.GetPropertyRemoveArray(type);
            }

            if (type == null) {
                throw new ConfigurationException("A null value has been provided for the type");
            }

            try {
                var clazz = TypeHelper.GetTypeForSimpleName(type, importService.ClassForNameProvider);
                if (clazz == null) {
                    return null;
                }

                if (isArray) {
                    clazz = clazz.MakeArrayType();
                }

                return clazz;
            }
            catch (TypeLoadException e) {
                Log.Error($"Unable to load type \"{e.Message}\"", e);
                return null;
            }
        }
Example #25
0
        public static void BuildMapTypes(
            EventTypeRepositoryImpl repo,
            IDictionary<string, ConfigurationCommonEventTypeMap> mapTypeConfigurations,
            IDictionary<string, Properties> mapTypes,
            IDictionary<string, IDictionary<string, object>> nestableMapEvents,
            BeanEventTypeFactory beanEventTypeFactory,
            ImportService importService)
        {
            var creationOrder = EventTypeRepositoryUtil.GetCreationOrder(mapTypes.Keys, nestableMapEvents.Keys, mapTypeConfigurations);
            foreach (var mapName in creationOrder) {
                if (repo.GetTypeByName(mapName) != null) {
                    continue;
                }

                var mapConfig = mapTypeConfigurations.Get(mapName);
                if (mapTypes.TryGetValue(mapName, out var propertiesUnnested)) {
                    var propertyTypes = CreatePropertyTypes(propertiesUnnested, importService);
                    var propertyTypesCompiled = EventTypeUtility.CompileMapTypeProperties(propertyTypes, repo);
                    AddNestableMapType(mapName, propertyTypesCompiled, mapConfig, repo, beanEventTypeFactory, repo);
                }

                if (nestableMapEvents.TryGetValue(mapName, out var propertiesNestable)) {
                    var propertiesNestableCompiled = EventTypeUtility.CompileMapTypeProperties(propertiesNestable, repo);
                    AddNestableMapType(mapName, propertiesNestableCompiled, mapConfig, repo, beanEventTypeFactory, repo);
                }
            }
        }
Example #26
0
        public static EventTypeAvroHandler Resolve(
            ImportService importService,
            ConfigurationCommonEventTypeMeta.AvroSettingsConfig avroSettings,
            string handlerClass)
        {
            // Make services that depend on snapshot config entries
            EventTypeAvroHandler avroHandler = EventTypeAvroHandlerUnsupported.INSTANCE;
            if (avroSettings.IsEnableAvro) {
                try {
                    avroHandler = TypeHelper.Instantiate<EventTypeAvroHandler>(
                        handlerClass,
                        importService.ClassForNameProvider);
                }
                catch (Exception t) {
                    Log.Debug(
                        "Avro provider {} not instantiated, not enabling Avro support: {}",
                        handlerClass,
                        t.Message);
                }

                try {
                    avroHandler.Init(avroSettings, importService);
                }
                catch (Exception t) {
                    throw new ConfigurationException("Failed to initialize Esper-Avro: " + t.Message, t);
                }
            }

            return avroHandler;
        }
Example #27
0
        private static Type ResolveClassForTypeName(
            string type,
            ImportService importService)
        {
            var isArray = false;
            if (type != null && EventTypeUtility.IsPropertyArray(type)) {
                isArray = true;
                type = EventTypeUtility.GetPropertyRemoveArray(type);
            }

            if (type == null) {
                throw new ConfigurationException("A null value has been provided for the type");
            }

            var clazz = TypeHelper.GetTypeForSimpleName(type, importService.ClassForNameProvider);
            if (clazz == null) {
                throw new ConfigurationException("The type '" + type + "' is not a recognized type");
            }

            if (isArray) {
                clazz = clazz.MakeArrayType();
            }

            return clazz;
        }
Example #28
0
        public App()
        {
            var waypointsService = new WaypointsService();
            var groupsService    = new GroupsService(waypointsService);

            GeoLayoutBuildingService = new GeoLayoutBuildingService(waypointsService, groupsService);
            SettingsService          = new SettingsService();

            var importService = new ImportService(
                new List <IGeoImporter>(new [] {
                new GpxImporter()
            }),
                new MultiFileDialogService(Current.MainWindow),
                waypointsService);

            var exportService = new ExportService(
                new List <IGeoExporter>(new [] {
                new GpxExporter()
            }),
                new SaveFileDialogService(Current.MainWindow),
                waypointsService);

            MainViewModel   = new MainViewModel(importService, exportService, waypointsService, groupsService, GeoLayoutBuildingService);
            MapViewModel    = new MapViewModel(waypointsService, groupsService, GeoLayoutBuildingService);
            GroupsViewModel = new GroupsViewModel(groupsService, waypointsService);
        }
Example #29
0
        public ActionResult Import()
        {
            var path    = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "bin");
            var service = new ImportService();
            var vm      = service.GetImportViewModel(path);

            return(View(vm));
        }
Example #30
0
 public override AggregationAgentForge GetAggregationStateAgent(
     ImportService importService,
     string statementName)
 {
     return new AggregationAgentCountMinSketchForge(
         AddOrFrequencyEvaluator,
         Parent.OptionalFilter == null ? null : Parent.OptionalFilter.Forge);
 }
 /// <summary>
 /// Gets the import manager.
 /// </summary>we
 /// <returns></returns>
 private ImportManager GetImportManager()
 {
     ImportManager importManager = Page.Session["importManager"] as ImportManager;
     if (importManager != null)
     {
         if (importProcessId.Value != importManager.ToString() && String.IsNullOrEmpty(txtImportFile.Value))
         {
             lblFileRequired.Visible = false;
             lblRequiredMsg.Visible = false;
             importManager = null;
         }
     }
     if (importManager == null)
     {
         try
         {
             LeadDuplicateProvider duplicateProvider = new LeadDuplicateProvider();
             txtCreateGroupName.Text = DateTime.Now.ToString();
             ImportService importService = new ImportService();
             importManager = importService.CreateImportManager(typeof(ILead));
             importProcessId.Value = importManager.ToString();
             importManager.DuplicateProvider = duplicateProvider;
             importManager.MergeProvider = new ImportLeadMergeProvider();
             importManager.ActionManager = GetActionManager();
         }
         catch (Exception ex)
         {
             string sSlxErrorId = null;
             var sMsg = ErrorHelper.GetClientErrorHtmlMessage(ex, ref sSlxErrorId);
             if (!string.IsNullOrEmpty(sSlxErrorId))
             {
                 log.Error(
                     ErrorHelper.AppendSlxErrorId("The call to StepSelectFile.GetImportManager() failed", sSlxErrorId),
                     ex);
             }
             divError.Style.Add(HtmlTextWriterStyle.Display, "inline");
             divMainContent.Style.Add(HtmlTextWriterStyle.Display, "none");
             lblError.Text = sMsg;
             (Parent.Parent.FindControl("StartNavigationTemplateContainerID").FindControl("cmdStartButton")).Visible = false;
         }
     }
     return importManager;
 }
 /// <summary>
 /// Gets the import manager.
 /// </summary>we
 /// <returns></returns>
 private ImportManager GetImportManager()
 {
     ImportManager importManager = Page.Session["importManager"] as ImportManager;
     if (importManager != null)
     {
         if (importProcessId.Value != importManager.ToString() && String.IsNullOrEmpty(txtImportFile.Value))
         {
             lblFileRequired.Visible = false;
             lblRequiredMsg.Visible = false;
             importManager = null;
         }
     }
     if (importManager == null)
     {
         try
         {
             LeadDuplicateProvider duplicateProvider = new LeadDuplicateProvider();
             txtCreateGroupName.Text = DateTime.Now.ToString();
             ImportService importService = new ImportService();
             importManager = importService.CreateImportManager(typeof(ILead));
             importManager.DuplicateProvider = duplicateProvider;
             importManager.MergeProvider = new ImportLeadMergeProvider();
             importManager.ActionManager = GetActionManager();
         }
         catch (Exception e)
         {
             divError.Style.Add(HtmlTextWriterStyle.Display, "inline");
             divMainContent.Style.Add(HtmlTextWriterStyle.Display, "none");
             lblError.Text = (e.Message);
             (Parent.Parent.FindControl("StartNavigationTemplateContainerID").FindControl("cmdStartButton")).Visible = false;
         }
     }
     return importManager;
 }