public void RefreshData() { IAccountHistoryRepository purchaseRepository = new AccountHistoryRepository(); this.JsonData = purchaseRepository.GetLastSelectionData(Convert.ToInt32(ScreenId.AccountHistory)); this.AccountHistoryList = purchaseRepository.GetAllSalesInvoiceJson(this.JsonData).ToList(); DefaultList = this.AccountHistoryList; SetDefaultSearchSelection(); this.YearRange = purchaseRepository.GetYearRange().ToList(); GetOptionsandTaxValues(); }
public UnitOfWork(DataContext context) { _context = context; Account = new AccountRepository(_context); AccountHistory = new AccountHistoryRepository(_context); AccountType = new AccountTypeRepository(_context); Business = new BusinessRepository(_context); Client = new ClientRepository(_context); Group = new GroupRepository(_context); Relationship = new RelationshipRepository(_context); Role = new RoleRepository(_context); Transaction = new TransactionRepository(_context); TransactionType = new TransactionTypeRepository(_context); User = new UserRepository(_context); UserHistory = new UserHistoryRepository(_context); }
public UnitOfWork(INavyAccountDbContext context) { this.context = context; Users = new UserRepository(context); Menus = new MenuRepository(context); RoleMenus = new RoleMenuRepository(context); MenuGroups = new MenuGroupRepository(context); UserRoles = new UserRoleRepository(context); FundType = new FundTypeRepo(context); actType = new AccountTypeRepository(context); balSheet = new BalanceSheetRepository(context); mainAccount = new MainAccountRepository(context); accountChart = new ChartRepository(context); subtype = new SubTypeRepository(context); fundTypeCode = new FundTypeRepository(context); loanType = new LoanTypeRepo(context); rank = new RankRepo(context); person = new PersonRepo(context); beneficiary = new BeneficiaryRepo(context); bank = new BankRepository(context); pfundrate = new PfFundRateRepository(context); contribution = new NPFContributionRepository(context); loanRegisterRepository = new LoanRegisterRepository(context); register = new InvestmentRegisterRepository(context); loanStatus = new LoanStatusRepository(context); schedule = new LoanScheduleRepository(context); balance = new TrialBalanceRepository(context); accountHistory = new AccountHistoryRepository(context); npf_Ledgers = new LedgerRepositoy(context); report = new TrialBalanceReportRepository(context); history = new TrialBalanceHistoryRepository(context); pf_loandisc = new LoandiscRepo(context); loanPerRank = new LoanPerRankRepository(context); claimregister = new ClaimRepository(context); npfHistories = new FinancialDocRepo(context); trail = new AuditRailRepository(context); npf_contrdisc = new ContrRepo(context); surplus = new SurplusRepository(context); cam = new ClaimTypeRepository(context); navip = new NavipRepository(context); loantypereview = new LoanTypeReviewRepo(context); }
public async Task LogUserActionToDatabaseAsync_UserIsNull_ThrowArgumentNullException() { try { var repo = new AccountHistoryRepository(); await repo.LogUserActionToDatabaseAsync(null, UserActionType.None, string.Empty); Assert.True(false, "No exception was thrown."); } catch (ArgumentException ex) { Assert.Equal("userId", ex.Message); } catch (Exception) { Assert.True(false, "Wrong type of exception was thrown."); } }
public UnitOfWork(DataContext context) { _context = context; Account = new AccountRepository(_context); AccountHistory = new AccountHistoryRepository(_context); AccountType = new AccountTypeRepository(_context); Business = new BusinessRepository(_context); Client = new ClientRepository(_context); Group = new GroupRepository(_context); Relationship = new RelationshipRepository(_context); Role = new RoleRepository(_context); Transaction = new TransactionRepository(_context); TransactionCode = new TransactionCodeRepository(_context); TransactionType = new TransactionTypeRepository(_context); TransactionTypeDetail = new TransactionTypeDetailRepository(_context); User = new UserRepository(_context); UserHistory = new UserHistoryRepository(_context); UserActivity = new UserActivityRepository(_context); Menu = new MenuRepository(_context); Control = new ControlRepository(_context); Image = new ImageRepository(_context); }
void Search(object param) { //UIServices.SetBusyState(); //DoProcessing(); if (Count != 0) { SearchValues = new List <SearchEntity>(); if (this.SelectedSearchYear != null && this.SelectedSearchYear != string.Empty) { SearchEntity value = new SearchEntity(); value.FieldName = "Year"; value.FieldValue = this.SelectedSearchYear; SearchValues.Add(value); var year = Convert.ToInt32(this.SelectedSearchYear); } else { SearchEntity value = new SearchEntity(); value.FieldName = "Year"; value.FieldValue = "0"; SearchValues.Add(value); } if (this.SelectedSearchQuarter != null && this.SelectedSearchQuarter != string.Empty) { SearchEntity value = new SearchEntity(); value.FieldName = "Quarter"; value.FieldValue = this.SelectedSearchQuarter; int month1; int month2; int month3; if (Convert.ToInt32(this.SelectedSearchQuarter) == 1) { month1 = 1; month2 = 2; month3 = 3; } else if (Convert.ToInt32(this.SelectedSearchQuarter) == 2) { month1 = 4; month2 = 5; month3 = 6; } else if (Convert.ToInt32(this.SelectedSearchQuarter) == 3) { month1 = 7; month2 = 8; month3 = 9; } else { month1 = 10; month2 = 11; month3 = 12; } SearchValues.Add(value); } else { SearchEntity value = new SearchEntity(); value.FieldName = "Quarter"; value.FieldValue = "0"; SearchValues.Add(value); } jsonSearch = JsonConvert.SerializeObject(SearchValues); this.JsonData = jsonSearch; IAccountHistoryRepository purchaseRepository = new AccountHistoryRepository(); var results = purchaseRepository.SaveSearchJson(jsonSearch, Convert.ToInt32(ScreenId.AccountHistory), "AccountHistory_List"); if (Count != 0) { if (JsonData != null) { AccountHistoryList = purchaseRepository.GetAllSalesInvoiceJson(this.JsonData).ToList(); } } } }