private void Init() { try { context = new RmsContext(); LedgerTransactions = new ObservableCollection <LedgerTransaction>(context.LedgerTransactions.ToList()); LedgerAccounts = new ObservableCollection <LedgerAccount>(); LedgerAccounts.Add(new Data.LedgerAccount { AccountName = "Initializing Data..." }); LedgerAccounts = new ObservableCollection <LedgerAccount>(context.LedgerAccounts.ToListAsync().Result); LedgerTransactionDetails = new ObservableCollection <LedgerTransactionDetail>(GetLedgerTransactionDetailAsync().Result); Ledgergenerals = new ObservableCollection <Ledgergeneral>(GetLedgersAsync().Result); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
ObservableCollection <LedgerAccount> acs;//= new ObservableCollection<Data.LedgerAccount>(context.LedgerAccounts.ToList()); public LedgerTAccount GetLedgerData(int LedgerTransactionId, RmsContext context) { LedgerTAccount Lta = new LedgerTAccount(); acs = new ObservableCollection <Data.LedgerAccount>(context.LedgerAccounts.ToList()); v = new ObservableCollection <Ledgergeneral> (context.Ledgergenerals.Where(a => a.LedgerTransactionId == LedgerTransactionId) .ToList()); foreach (var item in v) { if (item.Debit > 0) { Lta.DebitAccounts.Add(item.LedgerAccount); } if (item.Credit > 0) { Lta.CreditAccounts.Add(item.LedgerAccount); } } return(Lta); }
/// <summary> /// Constuctor for the Property Service /// </summary> /// <param name="context">Database context</param> public PropertyService(RmsContext context) { _context = context; }
/// <summary> /// Constructor for the class /// </summary> /// <param name="context">Database context</param> /// <param name="properties">Property service</param> /// <param name="payments">Payment service</param> public TenantService(RmsContext context, IProperty properties, IPayment payments) { _context = context; _properties = properties; _payments = payments; }
public GenericRepository(RmsContext ctx) { _ctx = ctx; _dbSet = _ctx.Set <TEntity>(); //_ctx.Configuration.AutoDetectChangesEnabled = true; }