public WorkflowContext(WorkflowContextData data, IDataContext dataContext) { if (data == null) { throw new ArgumentNullException(@"data"); } if (dataContext == null) { throw new ArgumentNullException(@"dataContext"); } _dataContext = dataContext; Data = data; var factory = AppServiceProviderFactoryProvider.GetFactory(); Provider = factory.Create(); /*_docRepo = new DocRepository(DataContext, UserId); * _userRepo = new UserRepository(DataContext); * _defRepo = new DocDefRepository(DataContext, UserId); * _orgRepo = new OrgRepository(DataContext/*, Data.UserId#1#); * _enumRepo = new EnumRepository(DataContext);*/ _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 UnitRepository(IUnitOfWork unitOfWork, IDocRepository docRepository, IDomainValidator validator) { this.unitOfWork = unitOfWork; this.docRepository = docRepository; this.validator = validator; unitsInContext = unitOfWork.DbContext.Set<Unit>(); }
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 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 ApplicationsController( IUnitOfWork unitOfWork, ILotRepository lotRepository, IPersonRepository personRepository, IOrganizationRepository organizationRepository, IAircraftRepository aircraftRepository, IAirportRepository airportRepository, IEquipmentRepository equipmentRepository, IDocRepository docRepository, IApplicationRepository applicationRepository, INomRepository nomRepository, IFileRepository fileRepository, IExaminationSystemRepository examinationSystemRepository, ILotEventDispatcher lotEventDispatcher, UserContext userContext) { this.unitOfWork = unitOfWork; this.lotRepository = lotRepository; this.personRepository = personRepository; this.organizationRepository = organizationRepository; this.aircraftRepository = aircraftRepository; this.airportRepository = airportRepository; this.equipmentRepository = equipmentRepository; this.docRepository = docRepository; this.applicationRepository = applicationRepository; this.nomRepository = nomRepository; this.examinationSystemRepository = examinationSystemRepository; this.fileRepository = fileRepository; this.lotEventDispatcher = lotEventDispatcher; this.userContext = userContext; }
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 DocsController(AppDbContext context, ILogger <DocsController> logger, IConfiguration configuration, IDocRepository docrepo) { _context = context; _logger = logger; _configuration = configuration; _docrepo = docrepo; int.TryParse(_configuration["SQL:PageRecords"], out pageRecords); }
public DocService(IHttpContextAccessor httpContextAccessor, IDocRepository repository, IMapper mapper, ILogger <DocController> logger) { _httpContextAccessor = httpContextAccessor; _repository = repository; _mapper = mapper; _logger = logger; }
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 AppCommunicatorService() { List<IDbConfiguration> configurations = new List<IDbConfiguration>(); configurations.Add(new DocsDbConfiguration()); configurations.Add(new CommonDbConfiguration()); this.unitOfWork = new UnitOfWork(configurations, Enumerable.Empty<IDbContextInitializer>()); this.docRepository = new DocRepository(unitOfWork); }
/// <summary> /// Controller for addresses /// </summary> public DocController(IHttpContextAccessor httpContextAccessor, IDocRepository repository, IMapper mapper, ILogger <DocController> logger, IDocService docService) { _httpContextAccessor = httpContextAccessor; _repository = repository; _logger = logger; _docService = docService; Directory.CreateDirectory(DocStore); }
public DocDataSet(IDataContext dataContext, IEnumerable <Guid> docs, Guid userId) { DataContext = dataContext; DocList = new List <Guid>(docs); var factory = AppServiceProviderFactoryProvider.GetFactory(); Provider = factory.Create(); _ownProvider = true; DocRepo = Provider.Get <IDocRepository>(); // new DocRepository(DataContext, userId); }
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 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>(); }
private IDocRepository TryGetDocRepo(Doc document) { if (document == null || String.IsNullOrEmpty(document.DataContextName)) { return(null); } IDocRepository repo = null; var dc = DataContext.Contexts.FirstOrDefault(c => String.Equals(c.Name, document.DataContextName, StringComparison.Ordinal)); if (dc != null) { _repositories.TryGetValue(dc, out repo); } return(repo); }
public AppController(IUnitOfWork unitOfWork, IAppRepository appRepository, IDocRepository docRepository, IUserRepository userRepository, IClassificationRepository classificationRepository, INomRepository nomRepository, IDataGenerator dataGenerator) { this.unitOfWork = unitOfWork; this.appRepository = appRepository; this.docRepository = docRepository; this.userRepository = userRepository; this.classificationRepository = classificationRepository; this.nomRepository = nomRepository; this.dataGenerator = dataGenerator; }
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 AplicationsCaseController( IUnitOfWork unitOfWork, ILotRepository lotRepository, IDocRepository docRepository, IApplicationRepository applicationRepository, IFileRepository fileRepository, ICaseTypeRepository caseTypeRepository, ILotEventDispatcher lotEventDispatcher, UserContext userContext) { this.unitOfWork = unitOfWork; this.lotRepository = lotRepository; this.docRepository = docRepository; this.applicationRepository = applicationRepository; this.lotEventDispatcher = lotEventDispatcher; this.fileRepository = fileRepository; this.caseTypeRepository = caseTypeRepository; this.userContext = userContext; }
public IncomingDocProcessor( Func<Owned<IUnitOfWork>> unitOfWorkFactory, IUnitOfWork unitOfWork, IDocRepository docRepository, IEmailRepository emailRepository, ICorrespondentRepository correspondentRepository, IRioObjectExtractor rioObjectExtractor, IRioDocumentParser rioDocumentParser, IRioValidator rioValidator) { this.unitOfWorkFactory = unitOfWorkFactory; this.unitOfWork = unitOfWork; this.docRepository = docRepository; this.emailRepository = emailRepository; this.correspondentRepository = correspondentRepository; this.rioObjectExtractor = rioObjectExtractor; this.rioDocumentParser = rioDocumentParser; this.rioValidator = rioValidator; }
public Doc GetDoc(IDocRepository docRepo) { //using (var docRepo = new DocRepository(Guid.Empty)) var doc = docRepo.CreateDoc(Query.Source.GetDocDef()); var i = 0; foreach (var attr in Query.Attributes) { if (attr.Source == Query.Source) { if (attr.Def == null) { switch (attr.Attribute.Ident) { case SystemIdent.Id: if (!Reader.IsDBNull(i)) { doc.Id = Reader.GetGuid(i); } break; case SystemIdent.Created: if (!Reader.IsDBNull(i)) { doc.CreationTime = Reader.GetDateTime(i); } break; case SystemIdent.UserId: if (!Reader.IsDBNull(i)) { doc.UserId = Reader.GetGuid(i); } break; case SystemIdent.OrgId: if (!Reader.IsDBNull(i)) { doc.OrganizationId = Reader.GetGuid(i); } break; case SystemIdent.State: if (!Reader.IsDBNull(i)) { if (doc.State == null) { doc.State = new DocState { Type = new DocStateType { Id = Reader.GetGuid(i) } } } } ; else { doc.State.Type = new DocStateType { Id = Reader.GetGuid(i) } }; break;
public BizService(IDocRepository docRepository, string currentUserName) { CurrentUserName = currentUserName; DocRepo = docRepository; }
public DocBusiness(IDocRepository docRepository, ICauHoiRepository cauHoiRepository) { _docRepository = docRepository; _cauHoiRepository = cauHoiRepository; }
public DocService(IDocRepository docRepository, IUnitOfWork unitOfWork, IMemoryCache cache) { _docRepository = docRepository; _unitOfWork = unitOfWork; _cache = cache; }
public IntegrationController( IDocRepository docRepository, IUnitOfWork unitOfWork, ILotRepository lotRepository, IPersonRepository personRepository, IApplicationRepository applicationRepository, ICaseTypeRepository caseTypeRepository, IIntegrationRepository integrationRepository, INomRepository nomRepository, ICorrespondentRepository correspondentRepository, IRioDocumentParser rioDocumentParser, UserContext userContext) { this.docRepository = docRepository; this.unitOfWork = unitOfWork; this.lotRepository = lotRepository; this.personRepository = personRepository; this.applicationRepository = applicationRepository; this.integrationRepository = integrationRepository; this.caseTypeRepository = caseTypeRepository; this.nomRepository = nomRepository; this.correspondentRepository = correspondentRepository; this.rioDocumentParser = rioDocumentParser; this.userContext = userContext; }
public DocListEnumerator(DocList docList) { _docList = docList; _docRepo = docList.Provider.Get <IDocRepository>(); //new DocRepository(docList.DataContext, docList.UserId); }
public DocumentsController() { db = new DocumentRepository(); }
public DocService(IDocRepository repository, IValidator <Doc> validator) { this.repository = repository; this.validator = validator; }
public DocsController(IDocRepository _docs) { this.docs = _docs; }
public DocumentsController(IDocRepository repository) { db = repository; }
private void FillDoc(DocumentBuilder builder, string prefix, DynaDoc doc) { var pref = String.IsNullOrEmpty(prefix) ? "" : prefix + "."; //foreach (var attr in doc.Doc.Attributes) //{ // var fn = Logger.GetLogFileName("ReportManagerError"); // Logger.OutputLog(fn, "ERROR BLOB: " + attr.AttrDef.Name + " ----- " + attr.GetType() + " ----- " + attr.ObjectValue.ToString().Length + " ----- " + (attr is BlobAttribute)); //} foreach (var attr in doc.Doc.Attributes) { var value = attr.ObjectValue; try { if (attr is BlobAttribute) { //var fn = Logger.GetLogFileName("ReportManagerError"); //Logger.OutputLog(fn, "ERROR BLOB: " + attr.AttrDef.Name + " ----- " + attr.GetType()); IDocRepository _docRepo = Provider.Get <IDocRepository>(); BlobData img = _docRepo.GetBlobAttrData(doc.Doc.Id, attr.AttrDef); //Logger.OutputLog(fn, "ERROR BLOB: " + img.FileName); // We assume only Image types blobs are used in reports builder.SetBlobField(pref + attr.AttrDef.Name, img.Data); continue; } } catch (Exception e) { var fn = Logger.GetLogFileName("ReportManagerError"); Logger.OutputLog(fn, e, e.Message); } if (value == null) { continue; } if (attr is DocAttribute) { var attrDoc = doc.GetAttrDoc((DocAttribute)attr); if (attrDoc != null) { using (var dynaDoc = new DynaDoc(attrDoc, UserId, Provider)) FillDoc(builder, pref + attr.AttrDef.Name, dynaDoc); } } else if (attr is DocListAttribute) { var index = 0; foreach (var docItem in doc.GetAttrDocList((DocListAttribute)attr)) { using (var dynaDoc = new DynaDoc(docItem, UserId, Provider)) FillDoc(builder, string.Format("{0}{1}.{2}", pref, attr.AttrDef.Name, index), dynaDoc); index++; } } else if (attr is EnumAttribute) { var enumValue = doc.GetAttrEnum((EnumAttribute)attr); if (enumValue != null) { builder.SetField(pref + attr.AttrDef.Name, enumValue.Value); } } else if (attr is DateTimeAttribute) { builder.SetField(pref + attr.AttrDef.Name, String.Format("{0:d}", value)); } else if (attr is CurrencyAttribute || attr is FloatAttribute) { builder.SetField(pref + attr.AttrDef.Name, String.Format("{0:F2}", value)); } else { builder.SetField(pref + attr.AttrDef.Name, value); } } }
public DocumentationService(IDocRepository repository) { _repo = repository; }
public DocService(IDocRepository repository) { this.Repository = repository; this.AddDisposableObjects(repository); }
public UserController(IDocRepository repository) { db = repository; }
public UserController() { db = new DocumentRepository(); }
public DocController(IDocRepository repo) { this.repo = repo; }