Ejemplo n.º 1
0
        public static async Task PopulateDictionaries(IApplicationBuilder app)
        {
            DictionaryDbContext context = app.ApplicationServices.GetRequiredService <DictionaryDbContext>();

            if (!context.DocumentTypes.Any(dt => dt.DocumentKind == DocumentKind.SalesOrder))
            {
                context.DocumentTypes.Add(new DocumentType {
                    Code = "SportsStore.SalesOrder", Symbol = "ZS", Name = "Zamówienie sprzedaży", DocumentKind = DocumentKind.SalesOrder
                });
            }

            if (!context.DocumentTypes.Any(dt => dt.DocumentKind == DocumentKind.Receipt))
            {
                context.DocumentTypes.Add(new DocumentType {
                    Code = "SportsStore.Receipt", Symbol = "PAR", Name = "Paragon", DocumentKind = DocumentKind.Receipt
                });
            }

            if (!context.DocumentTypes.Any(dt => dt.DocumentKind == DocumentKind.SalesInvoice))
            {
                context.DocumentTypes.Add(new DocumentType {
                    Code = "SportsStore.SalesInvoice", Symbol = "FS", Name = "Faktura sprzedaży", DocumentKind = DocumentKind.SalesInvoice
                });
            }

            if (!context.VatRates.Any())
            {
                context.VatRates.Add(new VatRate {
                    Symbol = "A", Value = 0.23m
                });
            }

            context.SaveChanges();
        }
Ejemplo n.º 2
0

        
Ejemplo n.º 3
0
 public TermRepository(DictionaryDbContext dbContext)
     : base(dbContext)
 {
 }
Ejemplo n.º 4
0

        
 public DocumentTypeRepository(DictionaryDbContext context)
 {
     _context = context;
 }
Ejemplo n.º 6
0
 public VatRateRepository(DictionaryDbContext context, IProductRepository productRepo, IOrderRepository orderRepo)
 {
     _context           = context;
     _productRepository = productRepo;
     _orderRepository   = orderRepo;
 }
 public DictionaryService(DictionaryDbContext context)
 {
     _context = context;
 }
Ejemplo n.º 8
0
 protected GenericRepository(DictionaryDbContext dbContext)
 {
     this.DictionaryDbContext = dbContext;
     this.DbSet = dbContext.Set <T>();
 }
Ejemplo n.º 9
0
 public DictionaryController(IDictionaryService dictionaryService, DictionaryDbContext dictionaryDbContext, ICurrentUserAccessor currentUserAccessor)
 {
     _dictionaryService   = dictionaryService;
     _dictionaryDbContext = dictionaryDbContext;
     _currentUserAccessor = currentUserAccessor;
 }
 public AccountController(IConfiguration configuration, DictionaryDbContext dictionaryDbContext)
 {
     _configuration       = configuration;
     _dictionaryDbContext = dictionaryDbContext;
 }