コード例 #1
0
ファイル: KapitalRepository.cs プロジェクト: medleykupps/Code
        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
ファイル: KapitalRepository.cs プロジェクト: medleykupps/Code
        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
ファイル: KapitalRepository.cs プロジェクト: medleykupps/Code
        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
ファイル: KapitalRepository.cs プロジェクト: medleykupps/Code
        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;
        }