private async Task SeedPeriods(IUnitOfWorkApplication uow)
 {
     uow.Periods.Insert(new Period
     {
         CreatedBy = 1,
         CreatedDate = DateTimeOffset.Now,
         Discription = "2018 January",
         PeriodDate = new DateTime(2018, 01, 01)
     });
     uow.Periods.Insert(new Period
     {
         CreatedBy = 1,
         CreatedDate = DateTimeOffset.Now,
         Discription = "2018 February",
         PeriodDate = new DateTime(2018, 02, 01)
     });
     uow.Periods.Insert(new Period
     {
         CreatedBy = 1,
         CreatedDate = DateTimeOffset.Now,
         Discription = "2018 March",
         PeriodDate = new DateTime(2018, 03, 01)
     });
     uow.Periods.Insert(new Period
     {
         CreatedBy = 1,
         CreatedDate = DateTimeOffset.Now,
         Discription = "2018 April",
         PeriodDate = new DateTime(2018, 04, 01)
     });
     await uow.SaveAsync();
 }
Exemplo n.º 2
0
 public ApplicationService(IUnitOfWorkApplicationDetails unitOfWork, IUnitOfWorkApplicationSearch unitOfWorkSearch, IUnitOfWorkApplication unitOfWorkApplication, IUnitOfWorkAccountSearch unitOfWorkAccountSearch)
 {
     _unitOfWorkApplicationDetails = unitOfWork;
     _unitOfWorkApplicationSearch  = unitOfWorkSearch;
     _unitOfWorkApplication        = unitOfWorkApplication;
     _unitOfWorkAccountSearch      = unitOfWorkAccountSearch;
 }
Exemplo n.º 3
0
 private async Task SeedAccounts(IUnitOfWorkApplication uow)
 {
     uow.Accounts.Insert(new Account
     {
         CreatedBy   = 1,
         CreatedDate = DateTimeOffset.Now,
         AccountName = "AccountName 01"
     });
     uow.Accounts.Insert(new Account
     {
         CreatedBy   = 1,
         CreatedDate = DateTimeOffset.Now,
         AccountName = "AccountName 02"
     });
     uow.Accounts.Insert(new Account
     {
         CreatedBy   = 1,
         CreatedDate = DateTimeOffset.Now,
         AccountName = "AccountName 03"
     });
     await uow.SaveAsync();
 }
        private async Task SeedAccounts(IUnitOfWorkApplication uow)
        {
            var rAndD = uow.Accounts.Insert(new Account
            {
                CreatedBy   = 1,
                CreatedDate = DateTimeOffset.Now,
                AccountName = "R&D"
            });
            var canteen = uow.Accounts.Insert(new Account
            {
                CreatedBy   = 1,
                CreatedDate = DateTimeOffset.Now,
                AccountName = "Canteen"
            });
            var ceoCar = uow.Accounts.Insert(new Account
            {
                CreatedBy   = 1,
                CreatedDate = DateTimeOffset.Now,
                AccountName = "CEOs Car"
            });

            var jan = uow.Periods.Insert(new Period
            {
                CreatedBy   = 1,
                CreatedDate = DateTimeOffset.Now,
                Discription = "January 2017",
                PeriodDate  = new DateTime(2017, 01, 01)
            });
            var feb = uow.Periods.Insert(new Period
            {
                CreatedBy   = 1,
                CreatedDate = DateTimeOffset.Now,
                Discription = "February 2017",
                PeriodDate  = new DateTime(2017, 02, 01)
            });
            await uow.SaveAsync();

            uow.AccountPeriodBalances.Insert(new AccountPeriodBalance
            {
                AccountId   = rAndD.AccountId,
                Balance     = 10.56M,
                CreatedBy   = 1,
                CreatedDate = DateTimeOffset.Now,
                PeriodId    = jan.PeriodId,
            });
            uow.AccountPeriodBalances.Insert(new AccountPeriodBalance
            {
                AccountId   = rAndD.AccountId,
                Balance     = 188.56M,
                CreatedBy   = 1,
                CreatedDate = DateTimeOffset.Now,
                PeriodId    = feb.PeriodId,
            });
            uow.AccountPeriodBalances.Insert(new AccountPeriodBalance
            {
                AccountId   = canteen.AccountId,
                Balance     = 77.56M,
                CreatedBy   = 1,
                CreatedDate = DateTimeOffset.Now,
                PeriodId    = jan.PeriodId,
            });
            uow.AccountPeriodBalances.Insert(new AccountPeriodBalance
            {
                AccountId   = canteen.AccountId,
                Balance     = 99M,
                CreatedBy   = 1,
                CreatedDate = DateTimeOffset.Now,
                PeriodId    = feb.PeriodId,
            });
            await uow.SaveAsync();
        }
 public UserAppService(IUnitOfWorkApplication uow)
 {
     Database = uow;
 }