示例#1
0
 public LinkService(NSCRegDbContext dbContext)
 {
     _dbContext      = dbContext;
     _commonSvc      = new Common(dbContext);
     _elasticService = new ElasticService(dbContext);
     _userService    = new UserService(dbContext);
 }
示例#2
0
 public EditService(NSCRegDbContext dbContext, StatUnitAnalysisRules statUnitAnalysisRules,
                    DbMandatoryFields mandatoryFields, ValidationSettings validationSettings)
 {
     _dbContext                 = dbContext;
     _statUnitAnalysisRules     = statUnitAnalysisRules;
     _mandatoryFields           = mandatoryFields;
     _userService               = new UserService(dbContext);
     _commonSvc                 = new Common(dbContext);
     _elasticService            = new ElasticService(dbContext);
     _validationSettings        = validationSettings;
     _dataAccessService         = new DataAccessService(dbContext);
     _deleteService             = new DeleteService(dbContext);
     _liquidateStatusId         = _dbContext.Statuses.FirstOrDefault(x => x.Code == "7")?.Id;
     _deletedStatusId           = _dbContext.Statuses.FirstOrDefault(x => x.Code == "8")?.Id;
     _editArrayStatisticalUnits = new List <ElasticStatUnit>();
     _addArrayStatisticalUnits  = new List <ElasticStatUnit>();
 }
示例#3
0
 public DeleteService(NSCRegDbContext dbContext)
 {
     _dbContext             = dbContext;
     _elasticService        = new ElasticService(dbContext);
     _dataAccessService     = new DataAccessService(dbContext);
     _commonSvc             = new Common(dbContext);
     _userService           = new UserService(dbContext);
     _deletedStatusId       = _dbContext.Statuses.FirstOrDefault(x => x.Code == "8")?.Id;
     _deleteUndeleteActions = new Dictionary <StatUnitTypes, Func <int, bool, string, IStatisticalUnit> >
     {
         [StatUnitTypes.EnterpriseGroup] = DeleteUndeleteEnterpriseGroupUnit,
         [StatUnitTypes.EnterpriseUnit]  = DeleteUndeleteEnterpriseUnit,
         [StatUnitTypes.LocalUnit]       = DeleteUndeleteLocalUnit,
         [StatUnitTypes.LegalUnit]       = DeleteUndeleteLegalUnit
     };
     _postDeleteActions = new Dictionary <StatUnitTypes, Action <IStatisticalUnit, bool, string> >
     {
         [StatUnitTypes.EnterpriseGroup] = PostDeleteEnterpriseGroupUnit,
         [StatUnitTypes.EnterpriseUnit]  = PostDeleteEnterpriseUnit,
         [StatUnitTypes.LocalUnit]       = PostDeleteLocalUnit,
         [StatUnitTypes.LegalUnit]       = PostDeleteLegalUnit
     };
 }