Пример #1
0
        private List <Transaction> GetInternal(int status)
        {
            var db = new TransactionDB(connectionString);

            return((from t in db.Transaction
                    where t.Status == status
                    select t).ToList());
        }
Пример #2
0
        private List <Transaction> GetInternal(string code)
        {
            var db = new TransactionDB(connectionString);

            return((from t in db.Transaction
                    where t.Code.Equals(code)
                    select t).ToList());
        }
Пример #3
0
        private List <Transaction> GetInternal(DateTime start, DateTime end)
        {
            var db = new TransactionDB(connectionString);

            return((from t in db.Transaction
                    where t.Date >= start.Date && t.Date <= end.Date
                    select t).ToList());
        }
Пример #4
0
        private void Add(List <Transaction> items)
        {
            var db = new TransactionDB(connectionString);

            foreach (var item in items)
            {
                db.Transaction.InsertOnSubmit(item);
            }

            try
            {
                db.SubmitChanges();
            }
            catch (SqlException)
            {
                // todo: perform log
            }
        }