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); }
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>(); }
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)); } } }
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)); } } }
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)); } } }
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)); } } }
// 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; } }
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>(); }
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>(); }
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); }
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); } } } } }
public MultiContextDocDefStateListProvider(IAppServiceProvider provider, IMultiDataContext dataContext) { _provider = provider; _dataContext = dataContext; }