Pokaż
Ignoruj:
Data:
2009-11-24 12:21:39 (16 years ago)
Autor:
sylwek
Opis:

Re #195 merged with latest trunk

Lokalizacja:
branches/Emisje
Pliki:
4 usunięte
8 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • branches/Emisje

    • Property svn:mergeinfo
      •  

        old new  
         1/branches/Abonament:701-884 
        12/branches/AutoShopper:815-818 
        23/branches/ReklamaReorganizacja:568-731 
        34/tags/BazaReklam_1.1.28:831 
        4 /trunk:774-868 
         5/trunk:774-893 
  • branches/Emisje/eCard/eCardMVC/Platnosci.Core/Interface/IRepository.cs

    r866 r895  
    44using System.Linq.Expressions; 
    55using System.Text; 
     6using Platnosci.Core.Linq; 
    67 
    78namespace Platnosci.Core.Interface 
     
    1617 
    1718        void Delete(T entity); 
    18  
    19         void Update(T entity); 
     19         
     20        void SubmitChanges(); 
    2021 
    2122        T FindOne(int id); 
     
    3637 
    3738        IQueryable<T> Find(Expression<Func<T, bool>> expression); 
     39 
     40        IQueryable<vPlatnosciEcard> FindInvoiceByNipNumber(string nip, string numer); 
     41 
     42        IQueryable<vPlatnosciEcard> FindInvoiceById(int id); 
     43 
     44        List<PotwierdzeniaEcard> FindItemsByIdFaktury(int idFaktury); 
     45 
     46        IQueryable<PlatnosciEcard> FindPaymentByOrdernumber(int ordernumber); 
    3847    } 
    3948} 
  • branches/Emisje/eCard/eCardMVC/Platnosci.Core/Linq/Payer.cs

    r866 r895  
    1111        public string LastName { get; set; } 
    1212        public int Id_faktury { get; set; } 
    13         public string Jezyk { get; set; } 
     13        public int status { get; set; } 
    1414    } 
    1515} 
  • branches/Emisje/eCard/eCardMVC/Platnosci.Core/Linq/Platnosci.cs

    r866 r895  
    1 namespace Platnosci.Core 
     1namespace Platnosci.Core     
    22{ 
    3     partial class PlatnosciDataContext 
     3    partial class PlatnosciDataContext  
    44    { 
    55    } 
  • branches/Emisje/eCard/eCardMVC/Platnosci.Core/Linq/Platnosci.designer.cs

    r866 r895  
    2222        using System.ComponentModel; 
    2323        using System; 
    24          
     24    using Platnosci.Core.Interface; 
    2525         
    2626        [System.Data.Linq.Mapping.DatabaseAttribute(Name="BAZA_REKLAM_TEST")] 
    27         public partial class PlatnosciDataContext : System.Data.Linq.DataContext 
     27        public partial class PlatnosciDataContext : DataContext 
    2828        { 
    29                  
    30                 private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource(); 
     29        private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource(); 
    3130                 
    3231    #region Extensibility Method Definitions 
     
    4847    partial void DeletevPlatnosciEcard(vPlatnosciEcard instance); 
    4948    #endregion 
    50     public PlatnosciDataContext() :  
    51                                 base(global::Platnosci.Core.Properties.Settings.Default.BAZA_REKLAM_TESTConnectionString, mappingSource) 
    52                 { 
    53                         OnCreated(); 
    54                 } 
    55                  
    56                 public PlatnosciDataContext(string connection) :  
    57                                 base(connection, mappingSource) 
    58                 { 
    59                         OnCreated(); 
    60                 } 
    61                  
    62                 public PlatnosciDataContext(System.Data.IDbConnection connection) :  
    63                                 base(connection, mappingSource) 
    64                 { 
    65                         OnCreated(); 
    66                 } 
    67                  
    68                 public PlatnosciDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :  
    69                                 base(connection, mappingSource) 
    70                 { 
    71                         OnCreated(); 
    72                 } 
    73                  
    74                 public PlatnosciDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :  
    75                                 base(connection, mappingSource) 
    76                 { 
    77                         OnCreated(); 
    78                 } 
    79                  
     49       public PlatnosciDataContext() :base(global::Platnosci.Core.Properties.Settings.Default.BAZA_REKLAM_TESTConnectionString, mappingSource) 
     50                { 
     51           OnCreated(); 
     52                } 
     53                 
     54                public PlatnosciDataContext(string connection) : base(connection, mappingSource) 
     55                { 
     56            OnCreated(); 
     57                } 
     58                 
     59                public PlatnosciDataContext(System.Data.IDbConnection connection) : base(connection, mappingSource) 
     60                { 
     61            OnCreated(); 
     62                } 
     63                 
     64                public PlatnosciDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :base(connection, mappingSource) 
     65                { 
     66            OnCreated(); 
     67                } 
     68                 
     69                public PlatnosciDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :base(connection, mappingSource) 
     70                { 
     71            OnCreated(); 
     72                } 
    8073                public System.Data.Linq.Table<PlatnosciEcard> PlatnosciEcards 
    8174                { 
  • branches/Emisje/eCard/eCardMVC/Platnosci.Core/Linq/PlatnosciDataContext.cs

    r866 r895  
    22using System.Collections.Generic; 
    33using System.Linq; 
     4using Platnosci.Core.Interface; 
    45 
    56namespace Platnosci.Core.Linq 
    67{ 
     8     
    79    public partial class PlatnosciDataContext 
    810    { 
    9         public IQueryable<vPlatnosciEcard> FindInvoiceByNipNumber(string nip, string numer) 
    10         { 
    11             var query = from i in vPlatnosciEcards 
    12                 where (i.nip == nip && i.Faktura_Numer == numer) 
    13                 select i; 
    14             return query;             
    15         } 
    16         public IQueryable<vPlatnosciEcard> FindInvoiceById(int id) 
    17         { 
    18             var query = from i in vPlatnosciEcards 
    19                         where i.ID_faktury == id 
    20                         select i; 
    21             return query; 
    22         } 
    23         public List<PotwierdzeniaEcard>FindItemsByIdFaktury(int idFaktury) 
    24         { 
    25             var query = from vp in PlatnosciEcards 
    26                         where vp.IDFaktury == idFaktury && vp.Status == true 
    27                         orderby vp.IDFaktury descending 
    28                         select vp; 
    29  
    30             query.ToList(); 
    31             var tablica = new List<PotwierdzeniaEcard>(); 
    32              
    33             foreach (var pt in query) 
    34             { 
    35                 var query2 = from ps in PotwierdzeniaEcards 
    36                              where ps.ORDERNUMBER == pt.ORDERNUMBER && ps.VALIDATIONCODE == "000" 
    37                              orderby ps.id 
    38                              select ps; 
    39                 
    40                 for (var i = 0; i < query2.ToList().Count; i++) 
    41                 { 
    42                     tablica.Add(query2.ToList()[i]); 
    43                 }               
    44             }             
    45             return tablica; 
    46         } 
     11        
    4712    } 
    4813} 
  • branches/Emisje/eCard/eCardMVC/Platnosci.Core/Linq/Repository.cs

    r867 r895  
    1515    /// <typeparam name="T">The generic type representing the entity we are dealing with</typeparam> 
    1616    /// <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 
    1918    { 
    20         private readonly PlatnosciDataContext _dataContext = new PlatnosciDataContext(); 
     19        protected readonly IDataContext _dataContext; 
    2120 
     21        public Repository(IDataContext dataContext) 
     22        { 
     23            _dataContext = dataContext; 
     24        }   
    2225        public int Count() 
    2326        { 
     
    5760            return _dataContext.GetTable<T>().Where(expression).ToList(); 
    5861        } 
    59  
    6062        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            } 
    7166        public void Delete(T entity) 
    7267        { 
    73             if (entity != null) 
    74             { 
    75                 _dataContext.GetTable<T>().DeleteOnSubmit(entity); 
    76                 _dataContext.SubmitChanges(); 
    77             } 
     68            throw new NotImplementedException(); 
    7869        } 
    79         public void Update(T entity) 
     70        public void SubmitChanges() 
    8071        { 
    8172            _dataContext.SubmitChanges(); 
     
    9283        { 
    9384            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        } 
    95102    } 
    96103} 
  • branches/Emisje/eCard/eCardMVC/Platnosci.Core/Platnosci.Core.csproj

    r866 r895  
    3333  </PropertyGroup> 
    3434  <ItemGroup> 
     35    <Reference Include="Elmah, Version=1.1.11517.0, Culture=neutral, processorArchitecture=MSIL"> 
     36      <SpecificVersion>False</SpecificVersion> 
     37      <HintPath>..\..\..\..\Documents and Settings\Administrator\Pulpit\bin\net-3.5\Debug\Elmah.dll</HintPath> 
     38    </Reference> 
    3539    <Reference Include="System" /> 
    3640    <Reference Include="System.Data" /> 
     
    6367  </ItemGroup> 
    6468  <ItemGroup> 
     69    <Compile Include="Interface\IDataContext.cs" /> 
    6570    <Compile Include="Interface\IIdentifiable.cs" /> 
    6671    <Compile Include="Interface\IRepository.cs" /> 
    67     <Compile Include="Interface\IRepositoryPE.cs" /> 
    68     <Compile Include="Interface\IRepositoryPT.cs" /> 
     72    <Compile Include="Linq\DataContext1.cs" /> 
    6973    <Compile Include="Linq\Payer.cs" /> 
    7074    <Compile Include="Linq\Platnosci.cs"> 
     
    7882    <Compile Include="Linq\PlatnosciDataContext.cs" /> 
    7983    <Compile Include="Linq\PlatnosciEcard.cs" /> 
     84    <Compile Include="Linq\PotwierdzeniaEcard.cs" /> 
    8085    <Compile Include="Linq\Repository.cs" /> 
    81     <Compile Include="Linq\RepositoryPlatnosciEcard.cs" /> 
    82     <Compile Include="Linq\RepositoryPotwierdzeniaEcard.cs" /> 
    8386    <Compile Include="Linq\vPlatnosciEcard.cs" /> 
    8487    <Compile Include="Linq\Waluta.cs" />