コード例 #1
0
        private FaciTechDbContext GetConnection()
        {
            var config           = GetConfigEntry();
            var connectionString = config.GetConnectionString("FacitechDb");
            DbContextOptionsBuilder dbContextOptionsBuilder = new DbContextOptionsBuilder();
            Guid userId    = Guid.Parse("09883535-d262-4c9b-8957-785636728445");
            var  dbContext = new FaciTechDbContext(dbContextOptionsBuilder.UseSqlServer(connectionString).Options);

            dbContext.UserId = userId;
            return(dbContext);
        }
コード例 #2
0
        public static T CreateService <T>(FaciTechDbContext context) where T : new()
        {
            var targetService = new T();
            FacitechBusinessService facitechBusinessService = targetService as FacitechBusinessService;

            if (facitechBusinessService != null)
            {
                facitechBusinessService._faciTechDbContext = context;
                facitechBusinessService.OnInt();
            }
            return(targetService);
        }
コード例 #3
0
        public static T Create <T>(FaciTechDbContext faciTechDbContext, Guid userId, Guid?contactId = null) where T : new()
        {
            var targetService = new T();
            FacitechBusinessService facitechBusinessService = targetService as FacitechBusinessService;

            if (facitechBusinessService != null)
            {
                facitechBusinessService.UserId = userId;
                if (contactId.HasValue)
                {
                    facitechBusinessService.ContactId = contactId.Value;
                }
                facitechBusinessService._faciTechDbContext = faciTechDbContext;
                facitechBusinessService.OnInt();
            }
            return(targetService);
        }
コード例 #4
0
        public static int GenerateSequence(this FaciTechDbContext faciTechDbContext, string key)
        {
            var numberGenerator = faciTechDbContext.NumberGenerator.Where(e => e.Key == key).FirstOrDefault();

            if (numberGenerator == null)
            {
                numberGenerator = new Database.Models.NumberGenerator()
                {
                    Key = key, Number = 1
                };
                faciTechDbContext.NumberGenerator.Add(numberGenerator);
            }
            else
            {
                numberGenerator.Number++;
            }
            faciTechDbContext.SaveChanges();
            return(numberGenerator.Number);
        }
コード例 #5
0
 public InvoiceSetupScheduleController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
 }
コード例 #6
0
 public ConsumptionRateCalculator(FaciTechDbContext faciTechDbContext, Guid consumptionId)
 {
     _faciTechDbContext  = faciTechDbContext;
     this._consumptionId = consumptionId;
 }
コード例 #7
0
 //private LocationService _locationService;
 public NotificationTypesController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
     //_locationService = CreateService<LocationService>();
 }
コード例 #8
0
 public UnitContactsController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
     _faciTechDbContext       = faciTechDbContext;
     this._unitContactService = CreateService <UnitContactService>();
     this._unitContactMapper  = new UnitContactMapper();
 }
コード例 #9
0
 public SubAreasController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
 }
コード例 #10
0
 public TicketsController(FaciTechDbContext faciTechDbContext, IMapper mapper) : base(faciTechDbContext, mapper)
 {
     _ticketMapper = new TicketMapper(mapper);
 }
コード例 #11
0
 public AssociationController(FaciTechDbContext faciTechDbContext, IMapper mapper) : base(faciTechDbContext, mapper)
 {
     _associationService = CreateService <AssociationService>();
 }
コード例 #12
0
 public InvoiceSetupGeneratorTask(FaciTechDbContext faciTechDbContext)
 {
     _faciTechDbContext = faciTechDbContext;
 }
コード例 #13
0
 public StatesController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
 }
コード例 #14
0
 public CommunityController(FaciTechDbContext faciTechDbContext, IMapper mapper)
 {
     _faciTechDbContext = faciTechDbContext;
     _locationService   = new LocationService(_faciTechDbContext);
     _mapper            = mapper;
 }
コード例 #15
0
 public HierarchyProviderFactory(FaciTechDbContext faciTechDbContext, Guid communityId)
 {
     this._faciTechDbContext = faciTechDbContext;
     this.communityId        = communityId;
 }
コード例 #16
0
 public AssetsController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
     _assetMapper = new AssetMapper();
 }
コード例 #17
0
 public CountriesController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
 }
コード例 #18
0
 public DirectMessageController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
 }
コード例 #19
0
 public MaintenanceRatesController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
     _maintenanceRateMapper = new MaintenanceRateMapper();
 }
コード例 #20
0
 public ServiceController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
 }
コード例 #21
0
 public SectionsController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
     _sectionService = CreateService <SectionService>();
 }
コード例 #22
0
 public SubAreasController(FaciTechDbContext faciTechDbContext)
 {
     _faciTechDbContext = faciTechDbContext;
 }
コード例 #23
0
 public StaffController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
     _staffMapper = new StaffMapper();
 }
コード例 #24
0
 public UnitsController(FaciTechDbContext faciTechDbContext, IMapper mapper) : base(faciTechDbContext, mapper)
 {
     this._unitMapper = new UnitMapper(mapper);
 }
コード例 #25
0
 public LocationHierarchyProvider(FaciTechDbContext faciTechDbContext)
 {
     this._faciTechDbContext = faciTechDbContext;
 }
コード例 #26
0
 public AmenitiesController(FaciTechDbContext faciTechDbContext, IMapper mapper) : base(faciTechDbContext, mapper)
 {
     _amenityMapper = new AmenityMapper(mapper);
 }
コード例 #27
0
 public NotificationController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
 }
コード例 #28
0
 public FacitechBusinessService(FaciTechDbContext faciTechDbContext)
 {
     this._faciTechDbContext = faciTechDbContext;
 }
コード例 #29
0
 public AmcsController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext)
 {
     _amcMapper = new AmcMapper();
 }
コード例 #30
0
 public MaintenanceRateCalculator(FaciTechDbContext faciTechDbContext, Guid communityId)
 {
     _faciTechDbContext = faciTechDbContext;
     this._communityId  = communityId;
 }