public FormHelper(IAppServiceProvider provider, BizForm form) { Form = form; _docDefRepo = provider.Get <IDocDefRepository>(); _formRepo = provider.Get <IFormRepository>(); }
public PermissionRepository(IAppServiceProvider provider, IDataContext dataContext) { DataContext = dataContext; //provider.Get<IDataContext>(); _userRepo = provider.Get <IUserRepository>(); _orgRepo = provider.Get <IOrgRepository>(); }
public DynaDoc(Guid docId, Guid userId, IDataContext dataContext) { var factory = AppServiceProviderFactoryProvider.GetFactory(); Provider = factory.Create(); _ownProvider = true; if (dataContext == null) { DataContext = Provider.Get <IDataContext>(); //new DataContext(); // _ownDataContext = true; } else { DataContext = dataContext; } UserId = userId; _docRepo = Provider.Get <IDocRepository>(); _docStateRepo = Provider.Get <IDocStateRepository>(); _userRepo = Provider.Get <IUserRepository>(); Doc = _docRepo.LoadById(docId); }
public DynaDoc(Doc doc, Guid userId, IAppServiceProvider provider) { if (doc == null) { throw new ApplicationException("Не могу создать динамический документ. Документ не передан!"); } Doc = doc; Provider = provider; DataContext = provider.Get <IDataContext>(); if (userId == Guid.Empty) { //var userData = Provider.Get<IUserDataProvider>(); UserId = Provider.GetCurrentUserId(); } else { UserId = userId; } _docRepo = Provider.Get <IDocRepository>(); _docStateRepo = Provider.Get <IDocStateRepository>(); _userRepo = Provider.Get <IUserRepository>(); }
public DynaDoc(Doc doc, Guid userId, IDataContext dataContext) { if (doc == null) { throw new ApplicationException("Не могу создать динамический документ. Документ не передан!"); } Doc = doc; var factory = AppServiceProviderFactoryProvider.GetFactory(); Provider = factory.Create(); _ownProvider = true; if (dataContext == null) { DataContext = Provider.Get <IDataContext>(); //new DataContext(); // _ownDataContext = true; } else { DataContext = dataContext; } UserId = userId; _docRepo = Provider.Get <IDocRepository>(); // new DocRepository(DataContext, UserId); _docStateRepo = Provider.Get <IDocStateRepository>(); // new DocStateRepository(DataContext); _userRepo = Provider.Get <IUserRepository>(); // new UserRepository(DataContext); }
public DocDefRepository(IAppServiceProvider provider, IDataContext dataContext) { Provider = provider; DataContext = dataContext ?? Provider.Get <IDataContext>(); UserId = Provider.GetCurrentUserId(); _enumRepo = Provider.Get <IEnumRepository>(); _permissionRepository = Provider.Get <IPermissionRepository>(); }
public QueryRepository(IAppServiceProvider provider, IDataContext dataContext) { DataContext = dataContext; _userId = provider.GetCurrentUserId(); _docDefRepo = provider.Get <IDocDefRepository>(); _permissionRepo = provider.Get <IPermissionRepository>(); }
public SqlQueryXmlBuilder(IAppServiceProvider provider, IDataContext dataContext, SqlQuery query) { Provider = provider; DataContext = dataContext; Query = query; _docRepo = Provider.Get <IDocRepository>(); _enumRepo = Provider.Get <IEnumRepository>(); _readerFactory = Provider.Get <ISqlQueryReaderFactory>(DataContext); }
public WorkflowEngine(IAppServiceProvider provider, IDataContext dataContext) { Provider = provider; DataContext = dataContext; //provider.Get<IDataContext>(); var userData = provider.Get <IUserDataProvider>(); UserId = userData.UserId; Repository = provider.Get <IWorkflowRepository>(); }
public SqlQueryDocSource(IAppServiceProvider provider, /*IDataContext dataContext, */ DocDef docDef, string alias) : base(alias) { Source = docDef; Provider = provider; // DataContext = dataContext; _docDefRepo = Provider.Get <IDocDefRepository>(); _mapper = Provider.Get <IDocumentTableMapRepository>(); _userRepo = Provider.Get <IUserRepository>(); }
public ControlFactory(IAppServiceProvider provider, IDataContext dataContext) { _dataContext = dataContext; //provider.Get<IDataContext>(); // UserId = provider.GetCurrentUserId(); //userDataProvider.UserId; // _enumRepo = provider.Get<IEnumRepository>(); _docDefRepo = provider.Get <IDocDefRepository>(); _permissionRepo = provider.Get <IPermissionRepository>(); // _comboBoxEnumProv = provider.Get<IComboBoxEnumProvider>(); _queryRepo = provider.Get <IQueryRepository>(); }
public SqlQueryDocSource(IAppServiceProvider provider, /*IDataContext dataContext,*/ Guid docDefId, string alias) : base(alias) { Provider = provider; //DataContext = dataContext; //using (var docDefRepo = new DocDefRepository(DataContext)) _docDefRepo = Provider.Get <IDocDefRepository>(); _mapper = Provider.Get <IDocumentTableMapRepository>(); _userRepo = Provider.Get <IUserRepository>(); Source = _docDefRepo.DocDefById(docDefId); }
public MultiContextFormRepository(IAppServiceProvider provider) { DataContext = provider.Get <IMultiDataContext>(); foreach (var context in DataContext.Contexts) { if (context.DataType.HasFlag(DataContextType.Meta)) { _repositories.Add(new FormRepository(provider, context)); } } _docRepo = provider.Get <IDocRepository>(); }
public bool CanExecute(BackupPlan plan) { var placeholders = new Placeholders(); systemOperations.LoadSystemPlaceholders(placeholders); var stepTypes = new HashSet <string>(plan.Steps.Select(step => step.StepType)); return (!stepTypes.Select(type => serviceProvider.Get <IStepExecution>(s => s.Type == type) ?.CanExecuteSupportedSteps(plan.Steps, placeholders)) .Any(result => !(result ?? true))); }
public XlsFormDefBuilder(IAppServiceProvider provider, BizForm form) { Provider = provider; DataContext = provider.Get <IDataContext>(); Form = form; //var userData = provider.Get<IUserDataProvider>(); UserId = provider.GetCurrentUserId(); //userData.UserId; _formRepo = Provider.Get <IFormRepository>(); _sqlQueryBuilderFactory = Provider.Get <ISqlQueryBuilderFactory>(); _sqlQueryReaderFactory = Provider.Get <ISqlQueryReaderFactory>(); _comboBoxValueProvider = Provider.Get <IComboBoxEnumProvider>(); }
public WorkflowContext(WorkflowContextData data, IAppServiceProvider provider) { if (data == null) { throw new ArgumentNullException(@"data"); } if (provider == null) { throw new ArgumentNullException(@"provider"); } Provider = provider; _dataContext = Provider.Find <IMultiDataContext>() ?? Provider.Get <IDataContext>(); Data = data; _docRepo = Provider.Get <IDocRepository>(); _userRepo = Provider.Get <IUserRepository>(); _defRepo = Provider.Get <IDocDefRepository>(); _orgRepo = Provider.Get <IOrgRepository>(); _enumRepo = Provider.Get <IEnumRepository>(); _sqlQueryBuilderFactory = Provider.Get <ISqlQueryBuilderFactory>(); _sqlQueryReaderFactory = Provider.Get <ISqlQueryReaderFactory>(); }
public XlsFormDefBuilder(IDataContext dataContext, BizForm form, Guid userId) { DataContext = dataContext; Form = form; UserId = userId; var providerFactory = AppServiceProviderFactoryProvider.GetFactory(); Provider = providerFactory.Create(dataContext, new UserDataProvider(UserId, "")); _formRepo = Provider.Get <IFormRepository>(); _sqlQueryBuilderFactory = Provider.Get <ISqlQueryBuilderFactory>(); _sqlQueryReaderFactory = Provider.Get <ISqlQueryReaderFactory>(); _comboBoxValueProvider = Provider.Get <IComboBoxEnumProvider>(); }
public override void Execute(WorkflowContext context, IAppServiceProvider provider, IDataContext dataContext) { //using (var docRepo = new DocRepository(dataContext, context.UserId)) var docRepo = provider.Get <IDocRepository>(); { try { var doc = context.CurrentDocument; if (doc != null) { docRepo.SetDocState(doc, DocStateTypeId); } else if (context.CurrentDocumentId != null) { docRepo.SetDocState((Guid)context.CurrentDocumentId, DocStateTypeId); } else { context.ThrowException("Document Id not found", "Идентификатор документа не найден!"); } base.Execute(context, provider, dataContext); } catch (Exception e) { OnException(context, e); context.ThrowException(e); } } }
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 IEnumerable <DocStateType> Get(Guid docDefId) { return (_dataContext.Contexts.Where(context => context.DataType.HasFlag(DataContextType.Document)) .Select(context => _provider.Get <IDocDefStateListProvider>(context)) .SelectMany(prov => prov.Get(docDefId))); }
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 MultiContextSqlQueryReaderFactory(IAppServiceProvider provider) { var multiDC = provider.Get <IMultiDataContext>(); var dataContext = multiDC.Contexts.First(dc => dc.DataType.HasFlag(DataContextType.Document)); Factory = new SqlQueryReaderFactory(provider, dataContext); }
public DocDataSet(IAppServiceProvider provider, IDataContext dataContext, IEnumerable <Guid> docs, Guid userId) { Provider = provider; _ownProvider = false; DataContext = dataContext; DocList = new List <Guid>(docs); DocRepo = Provider.Get <IDocRepository>(); // new DocRepository(DataContext, userId); }
public QueryCsvWriter(IAppServiceProvider provider, IDataContext dataContext, SqlQuery query, StreamWriter writer) { Provider = provider; DataContext = dataContext; Query = query; Writer = writer; _sqlQueryBuilder = provider.Get <ISqlQueryBuilder>(); }
public QueryCsvWriter(IAppServiceProvider provider, IDataContext dataContext, QueryDef queryDef, StreamWriter writer, Guid userId) { Provider = provider; DataContext = dataContext; QueryDef = queryDef; Writer = writer; UserId = userId; _sqlQueryBuilder = provider.Get <ISqlQueryBuilder>(); }
public DynaDoc(Guid docId, Guid userId, IAppServiceProvider provider) { Provider = provider; if (userId == Guid.Empty) { // var userData = Provider.Get<IUserDataProvider>(); UserId = provider.GetCurrentUserId(); } else { UserId = userId; } _docRepo = Provider.Get <IDocRepository>(); _docStateRepo = Provider.Get <IDocStateRepository>(); _userRepo = Provider.Get <IUserRepository>(); Doc = _docRepo.LoadById(docId); }
public MultiContextDocStateRepository(IAppServiceProvider provider) { DataContext = provider.Get <IMultiDataContext>(); foreach (var context in DataContext.Contexts) { if (context.DataType.HasFlag(DataContextType.Meta)) { _repositories.Add(new DocStateRepository(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)); } } }
public MultiContextPermissionRepository(IAppServiceProvider provider) { DataContext = provider.Get <IMultiDataContext>(); foreach (var context in DataContext.Contexts) { if (context.DataType.HasFlag(DataContextType.Account)) { _repositories.Add(new PermissionRepository(provider, context)); } } }
public UserDataProvider(string userName, string password, IAppServiceProvider provider) { var userRepo = provider.Get <IUserRepository>(); var userId = userRepo.FindUserId(userName, password); if (userId == null) { throw new ApplicationException(String.Format("Username \"{0}\" not found", userName)); } UserId = (Guid)userId; UserName = userName; }