Zbiór zmian 895 dla branches/Emisje/eCard/eCardMVC/Platnosci.Core/Linq/Repository.cs
- Data:
- 2009-11-24 12:21:39 (16 years ago)
- Lokalizacja:
- branches/Emisje
- Pliki:
-
- 2 zmodyfikowane
-
. (zmodyfikowane) (1 prop)
-
eCard/eCardMVC/Platnosci.Core/Linq/Repository.cs (zmodyfikowane) (3 diffs)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
branches/Emisje
- Property svn:mergeinfo
-
old new 1 /branches/Abonament:701-884 1 2 /branches/AutoShopper:815-818 2 3 /branches/ReklamaReorganizacja:568-731 3 4 /tags/BazaReklam_1.1.28:831 4 /trunk:774-8 685 /trunk:774-893
-
- Property svn:mergeinfo
-
branches/Emisje/eCard/eCardMVC/Platnosci.Core/Linq/Repository.cs
r867 r895 15 15 /// <typeparam name="T">The generic type representing the entity we are dealing with</typeparam> 16 16 /// <remarks>We use a 1 to 1 mapping of entity -> SQL table</remarks> 17 public sealed class Repository<T> : IRepository<T> 18 where T : class, IIdentifiable 17 public class Repository<T> : IRepository<T> where T : class, IIdentifiable 19 18 { 20 pr ivate readonly PlatnosciDataContext _dataContext = new PlatnosciDataContext();19 protected readonly IDataContext _dataContext; 21 20 21 public Repository(IDataContext dataContext) 22 { 23 _dataContext = dataContext; 24 } 22 25 public int Count() 23 26 { … … 57 60 return _dataContext.GetTable<T>().Where(expression).ToList(); 58 61 } 59 60 62 public void Insert(T entity) 61 { 62 //DataContext.GetTable<T>().InsertOnSubmit(entity); 63 //DataContext.SubmitChanges(); 64 65 //using (DataContext dc = new WierszowkiDataContext()) 66 //{ 67 _dataContext.GetTable<T>().InsertOnSubmit(entity); 68 _dataContext.SubmitChanges(); 69 //} 70 } 63 { 64 _dataContext.Insert(entity); 65 } 71 66 public void Delete(T entity) 72 67 { 73 if (entity != null) 74 { 75 _dataContext.GetTable<T>().DeleteOnSubmit(entity); 76 _dataContext.SubmitChanges(); 77 } 68 throw new NotImplementedException(); 78 69 } 79 public void Update(T entity)70 public void SubmitChanges() 80 71 { 81 72 _dataContext.SubmitChanges(); … … 92 83 { 93 84 return _dataContext.GetTable<T>(); 94 } 85 } 86 public IQueryable<vPlatnosciEcard> FindInvoiceByNipNumber(string nip, string numer) 87 { 88 return _dataContext.FindInvoiceByNipNumber(nip, numer); 89 } 90 public IQueryable<vPlatnosciEcard> FindInvoiceById(int id) 91 { 92 return _dataContext.FindInvoiceById(id); 93 } 94 public List<PotwierdzeniaEcard> FindItemsByIdFaktury(int idFaktury) 95 { 96 return _dataContext.FindItemsByIdFaktury(idFaktury); 97 } 98 public IQueryable<PlatnosciEcard> FindPaymentByOrdernumber(int ordernumber) 99 { 100 return _dataContext.FindPaymentByOrdernumber(ordernumber); 101 } 95 102 } 96 103 }
