Пример #1
0
        public static ComputingCore InitComputingCore()
        {
            var data_cell_repository      = new DataCellRepository();
            var function_repository       = new FunctionRepository(data_cell_repository);
            var command_repository        = new CommandRepository();
            var control_execution_service = new ControlExecutionService();

            var execution_manager = new ExecutionManager(
                new List <IExecutionService>()
            {
                new BasicExecutionService(),
                control_execution_service,
                new CSharpExecutionService(function_repository)
            }
                );

            var job_manager = new JobManager(execution_manager);
            var preparation_command_service = new PreparationCommandService(data_cell_repository, function_repository);
            var data_flow_logics_service    = new DataFlowLogicsService(job_manager, preparation_command_service, data_cell_repository);

            control_execution_service.SetDataFlowLogicsService(data_flow_logics_service);

            var computing_core = new ComputingCore(
                function_repository,
                data_cell_repository,
                command_repository,
                data_flow_logics_service
                );

            function_repository.Add(BasicFunctionModel.AllMethods.Select(x => (Function)x.Value.BasicFunction).ToList());

            return(computing_core);
        }
Пример #2
0
        public static bool SaveObjectWithControl(Function ObjectToSave)
        {
            FunctionRepository FuncRepository = new FunctionRepository();

            if (FuncRepository.Add(ObjectToSave) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #3
0
 public bool Add(string ModuleId, string FunctionName, string ControlName, string IndicateImage)
 {
     try
     {
         var module   = ModuleRepository.GetQueryable().FirstOrDefault(m => m.ModuleID == new Guid(ModuleId));
         var function = new Function();
         function.FunctionID    = Guid.NewGuid();
         function.FunctionName  = FunctionName;
         function.ControlName   = ControlName;
         function.Module        = module;
         function.IndicateImage = IndicateImage;
         FunctionRepository.Add(function);
         FunctionRepository.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Пример #4
0
 public bool Add(string ModuleId, string FunctionName, string ControlName, string IndicateImage)
 {
     try
     {
         //var module = ModuleRepository.GetQueryable().FirstOrDefault(m => m.ModuleID == new Guid(ModuleId));
         var module   = ModuleRepository.GetQueryable().FirstOrDefault(m => m.MODULE_ID == ModuleId);
         var function = new AUTH_FUNCTION();
         //function.FUNCTION_ID = Guid.NewGuid().ToString();
         function.FUNCTION_ID    = FunctionRepository.GetNewID("AUTH_FUNCTION", "FUNCTION_ID");
         function.FUNCTION_NAME  = FunctionName;
         function.CONTROL_NAME   = ControlName;
         function.AUTH_MODULE    = module;
         function.INDICATE_IMAGE = IndicateImage;
         FunctionRepository.Add(function);
         FunctionRepository.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         throw e;
     }
 }