コード例 #1
0
ファイル: BizService.svc.cs プロジェクト: tilekchubakov/CISSA
        public BizService(IAppServiceProvider provider, string currentUserName)
        {
            _monitor = new Monitor("BizService session");

            _dataContext    = provider.Get <IMultiDataContext>();
            CurrentUserName = currentUserName;

            Provider = provider;
            UserRepo = Provider.Get <IUserRepository>();

            var serviceRegistrator = Provider.Get <IAppServiceProviderRegistrator>();

            serviceRegistrator.AddService(new UserDataProvider(CurrentUserId, CurrentUserName));

            EnumRepo   = Provider.Get <IEnumRepository>();
            DocRepo    = Provider.Get <IDocRepository>();
            DocDefRepo = Provider.Get <IDocDefRepository>();
            FormRepo   = Provider.Get <IFormRepository>();
            var workflowRepo = Provider.Get <IWorkflowRepository>();

            WorkflowRepo   = workflowRepo;
            WorkflowEngine = Provider.Get <IWorkflowEngine>();

            ReportGeneratorProvider = Provider.Get <ITemplateReportGeneratorProvider>();
            LangRepo = Provider.Get <ILanguageRepository>();

            _sqlQueryBuilderFactory = Provider.Get <ISqlQueryBuilderFactory>();
            _sqlQueryReaderFactory  = Provider.Get <ISqlQueryReaderFactory>();
            _comboBoxValueProvider  = Provider.Get <IComboBoxEnumProvider>();

            _id = RegisterProcess(CurrentUserId, CurrentUserName);
        }
コード例 #2
0
ファイル: UserManager.cs プロジェクト: tilekchubakov/CISSA
        public BizService(IMultiDataContext dataContext, string currentUserName)
        {
            CurrentUserName = currentUserName;

            _dataContext = dataContext;

            var factory = AppServiceProviderFactoryProvider.GetFactory();

            Provider = factory.Create(DataContext); //new AppServiceProvider(DataContext);

            UserRepo = Provider.Get <IUserRepository>();

            var serviceRegistrator = Provider.Get <IAppServiceProviderRegistrator>();

            serviceRegistrator.AddService(new UserDataProvider(CurrentUserId, CurrentUserName));

            EnumRepo = Provider.Get <IEnumRepository>();
            DocRepo  = Provider.Get <IDocRepository>();
            FormRepo = Provider.Get <IFormRepository>();
            var workflowRepo = Provider.Get <IWorkflowRepository>();

            WorkflowRepo   = workflowRepo;
            WorkflowEngine = Provider.Get <IWorkflowEngine>();

            ReportGeneratorProvider = Provider.Get <ITemplateReportGeneratorProvider>();
            LangRepo = Provider.Get <ILanguageRepository>();

            _sqlQueryBuilderFactory = Provider.Get <ISqlQueryBuilderFactory>();
            _sqlQueryReaderFactory  = Provider.Get <ISqlQueryReaderFactory>();
        }
コード例 #3
0
        public MultiContextWorkflowRepository(IAppServiceProvider provider)
        {
            DataContext = provider.Get <IMultiDataContext>();

            foreach (var context in DataContext.Contexts)
            {
                if (context.DataType.HasFlag(DataContextType.Meta))
                {
                    _repositories.Add(new WorkflowRepository(provider, context));
                }
            }
        }
コード例 #4
0
        public MultiContextOrgRepository(IAppServiceProvider provider)
        {
            DataContext = provider.Get <IMultiDataContext>();

            foreach (var context in DataContext.Contexts)
            {
                if (context.DataType.HasFlag(DataContextType.Account))
                {
                    _repositories.Add(new OrgRepository(context));
                }
            }
        }
コード例 #5
0
        public MultiContextDocumentTableMapRepository(IAppServiceProvider provider)
        {
            DataContext = provider.Get <IMultiDataContext>();

            foreach (var context in DataContext.Contexts)
            {
                if (context.DataType.HasFlag(DataContextType.Meta))
                {
                    _repositories.Add(new DocumentTableMapRepository(context));
                }
            }
        }
コード例 #6
0
 public MultiContextQueryRepository(IAppServiceProvider provider)
 {
     Provider    = provider;
     DataContext = provider.Get <IMultiDataContext>();
     foreach (var context in DataContext.Contexts)
     {
         if (context.DataType.HasFlag(DataContextType.Meta))
         {
             _repositories.Add(context, new QueryRepository(Provider, context));
         }
     }
 }
コード例 #7
0
ファイル: BizService.svc.cs プロジェクト: tilekchubakov/CISSA
//        private static readonly Logger Log = LogManager.GetCurrentClassLogger();

        public BizService()
        {
            try
            {
                _monitor = new Monitor("BizService session");

                /*Connection = new EntityConnection("name=cissaEntities");
                 * _ownConnection = true;*/
                CurrentUserName = ServiceSecurityContext.Current.PrimaryIdentity.Name;
//              Log.Info(string.Format("Система запущена пользователем {0}", CurrentUserName));

                //var dc = new DataContext(Connection);
                var dataContextFactory = DataContextFactoryProvider.GetFactory();

                _dataContext    = dataContextFactory.CreateMultiDc(BaseServiceFactory.DataContextConfigSectionName); //new MultiDataContext(/*new[] {dc}*/);
                _ownDataContext = true;

                var providerFactory = AppServiceProviderFactoryProvider.GetFactory();
                Provider = providerFactory.Create(DataContext);

                UserRepo = Provider.Get <IUserRepository>(); // new UserRepository(Provider);

                var serviceRegistrator = Provider.Get <IAppServiceProviderRegistrator>();
                serviceRegistrator.AddService(new UserDataProvider(CurrentUserId, CurrentUserName));

                EnumRepo   = Provider.Get <IEnumRepository>();           //new EnumRepository(Provider);
                DocRepo    = Provider.Get <IDocRepository>();            //new DocRepository(DataContext, CurrentUserId);
                DocDefRepo = Provider.Get <IDocDefRepository>();
                FormRepo   = Provider.Get <IFormRepository>();           //new FormRepository(DataContext, CurrentUserId);
                var workflowRepo = Provider.Get <IWorkflowRepository>(); //new WorkflowRepository(DataContext);
                WorkflowRepo   = workflowRepo;
                WorkflowEngine = Provider.Get <IWorkflowEngine>();
                //new WorkflowEngine(DataContext, workflowRepo, CurrentUserId);

                ReportGeneratorProvider = Provider.Get <ITemplateReportGeneratorProvider>();
                //new TemplateReportGeneratorProvider(DataContext, CurrentUserId);
                //PdfTempRepo = new PdfTemplateRepository(DataContext, CurrentUserId);
                //ExcelTempRepo = new ExcelTemplateRepository(DataContext, CurrentUserId);
                LangRepo = Provider.Get <ILanguageRepository>();

                _sqlQueryBuilderFactory = Provider.Get <ISqlQueryBuilderFactory>();
                _sqlQueryReaderFactory  = Provider.Get <ISqlQueryReaderFactory>();
                _comboBoxValueProvider  = Provider.Get <IComboBoxEnumProvider>();

                _id = RegisterProcess(CurrentUserId, CurrentUserName);
            }
            catch (Exception e)
            {
                Logger.OutputLog(e, "BizService construction");
                throw;
            }
        }
コード例 #8
0
        public MultiContextDocRepository(IAppServiceProvider provider)
        {
            DataContext = provider.Get <IMultiDataContext>();

            foreach (var context in DataContext.Contexts)
            {
                if (context.DataType.HasFlag(DataContextType.Document))
                {
                    _repositories.Add(context, new DocRepository(provider, context));
                }
            }

            _docDefRepo = provider.Get <IDocDefRepository>();
        }
コード例 #9
0
        public MultiContextComboBoxEnumProvider(IAppServiceProvider provider)
        {
            Provider    = provider;
            DataContext = Provider.Get <IMultiDataContext>();

            foreach (var context in DataContext.Contexts)
            {
                if (context.DataType.HasFlag(DataContextType.Document))
                {
                    _repositories.Add(context, new ComboBoxEnumProvider(Provider, context));
                }
            }
            _enumRepo = Provider.Get <IEnumRepository>();
            _userRepo = Provider.Get <IUserRepository>();
            _orgRepo  = Provider.Get <IOrgRepository>();
        }
コード例 #10
0
ファイル: BizService.svc.cs プロジェクト: tilekchubakov/CISSA
        public BizService(string userName)
        {
            _monitor = new Monitor("BizService session");

            /*Connection = new EntityConnection("name=cissaEntities");
             * _ownConnection = true;*/
            CurrentUserName = userName;

            //var dc = new DataContext(Connection);
            var dataContextFactory = DataContextFactoryProvider.GetFactory();

            _dataContext    = dataContextFactory.CreateMultiDc(BaseServiceFactory.DataContextConfigSectionName); //new MultiDataContext(/*new[] { dc }*/);
            _ownDataContext = true;

            var providerFactory = AppServiceProviderFactoryProvider.GetFactory();

            Provider = providerFactory.Create(DataContext);

            UserRepo = Provider.Get <IUserRepository>(); // new UserRepository(Provider);

            var serviceRegistrator = Provider.Get <IAppServiceProviderRegistrator>();

            serviceRegistrator.AddService(new UserDataProvider(CurrentUserId, CurrentUserName));

            EnumRepo   = Provider.Get <IEnumRepository>();           //new EnumRepository(Provider);
            DocRepo    = Provider.Get <IDocRepository>();            //new DocRepository(DataContext, CurrentUserId);
            DocDefRepo = Provider.Get <IDocDefRepository>();
            FormRepo   = Provider.Get <IFormRepository>();           //new FormRepository(DataContext, CurrentUserId);
            var workflowRepo = Provider.Get <IWorkflowRepository>(); //new WorkflowRepository(DataContext);

            WorkflowRepo   = workflowRepo;
            WorkflowEngine = Provider.Get <IWorkflowEngine>(); //new WorkflowEngine(DataContext, workflowRepo, CurrentUserId);

            ReportGeneratorProvider = Provider.Get <ITemplateReportGeneratorProvider>();
            //new TemplateReportGeneratorProvider(DataContext, CurrentUserId);
            //PdfTempRepo = new PdfTemplateRepository(DataContext, CurrentUserId);
            //ExcelTempRepo = new ExcelTemplateRepository(DataContext, CurrentUserId);
            LangRepo = Provider.Get <ILanguageRepository>();

            _sqlQueryBuilderFactory = Provider.Get <ISqlQueryBuilderFactory>();
            _sqlQueryReaderFactory  = Provider.Get <ISqlQueryReaderFactory>();
            _comboBoxValueProvider  = Provider.Get <IComboBoxEnumProvider>();

            _id = RegisterProcess(CurrentUserId, CurrentUserName);
        }
コード例 #11
0
        public Service()
        {
            if (dataContextFactory == null)
            {
                dataContextFactory = DataContextFactoryProvider.GetFactory();

                if (dataContext == null)
                {
                    dataContext = dataContextFactory.CreateMultiDc("DataContexts");
                    BaseServiceFactory.CreateBaseServiceFactories();
                    if (providerFactory == null)
                    {
                        providerFactory = AppServiceProviderFactoryProvider.GetFactory();
                        if (provider == null)
                        {
                            provider = providerFactory.Create(dataContext);
                        }
                    }
                }
            }
        }
コード例 #12
0
 public MultiContextDocDefStateListProvider(IAppServiceProvider provider, IMultiDataContext dataContext)
 {
     _provider    = provider;
     _dataContext = dataContext;
 }