示例#1
0
        public BO.User GetUser(string username)
        {
            BO.User user = null;

            using (KapitalDataContext context = new KapitalDataContext(ConnectionString))
            {
                RepositoryAdapter<BO.User, User, UserCopyExtensions> adapter =
                    new RepositoryAdapter<BO.User, User, UserCopyExtensions>(this);

                user = adapter.Get(context.Users.Where(u => String.Compare(u.Username, username, true) == 0));
            }

            return user;
        }
示例#2
0
        public BO.Transaction GetTransaction(int transactionId)
        {
            BO.Transaction transaction = null;

            using (KapitalDataContext context = new KapitalDataContext(ConnectionString))
            {
                RepositoryAdapter<BO.Transaction, Transaction, TransactionCopyExtensions> adapter =
                    new RepositoryAdapter<BO.Transaction, Transaction, TransactionCopyExtensions>(this);

                transaction = adapter.Get(context.Transactions.Where(t => t.TransactionId == transactionId));
            }

            return transaction;
        }
示例#3
0
        public BO.User GetUser(int id)
        {
            BO.User user = null;

            using (KapitalDataContext context = new KapitalDataContext(ConnectionString))
            {
                RepositoryAdapter<BO.User, User, UserCopyExtensions> adapter =
                    new RepositoryAdapter<BO.User, User, UserCopyExtensions>(this);

                user = adapter.Get(context.Users.Where(u => u.UserId == id));
            }

            return user;
        }
示例#4
0
        public BO.Bank GetBank(int id)
        {
            BO.Bank bank = null;

            using (KapitalDataContext context = new KapitalDataContext(ConnectionString))
            {
                RepositoryAdapter<BO.Bank, Bank, BankCopyExtensions> adapter =
                    new RepositoryAdapter<BO.Bank, Bank, BankCopyExtensions>(this);

                bank = adapter.Get(context.Banks.Where(b => b.BankId == id));
            }

            return bank;
        }