Pokaż
Ignoruj:
Data:
2009-11-03 16:06:42 (16 years ago)
Autor:
alina
Opis:

re #215

Pliki:
1 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • trunk/eCard/eCardMVC/Platnosci.Core/Linq/PlatnosciDataContext.cs

    r866 r870  
    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}