root/trunk/eCard/eCardMVC/Platnosci.Core/Linq/PlatnosciDataContext.cs @ 866

Wersja 866, 1.7 KB (wprowadzona przez alina, 16 years temu)

re #215

Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4
5namespace Platnosci.Core.Linq
6{
7    public partial class PlatnosciDataContext
8    {
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        }
47    }
48}
Notatka: Zobacz TracBrowser aby uzyskać więcej informacji.