Created
November 1, 2012 18:55
-
-
Save thePunderWoman/3995712 to your computer and use it in GitHub Desktop.
PIES REport stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Part> parts = new List<Part>(); | |
int partcount = db.CustomerReportParts.Where(x => x.customerID.Equals(customerID)).Select(x => x.partID).Count(); | |
if (start == null) { | |
if (partcount == 0) { | |
parts = db.Parts.OrderBy(x => x.partID).ToList<Part>(); | |
} else { | |
parts = (from p in db.Parts | |
join crp in db.CustomerReportParts on p.partID equals crp.partID | |
orderby p.partID | |
select p).ToList<Part>(); | |
} | |
} else { | |
if (partcount == 0) { | |
parts = db.Parts.Where(x => x.dateModified >= start).OrderBy(x => x.partID).ToList<Part>(); | |
} else { | |
parts = (from p in db.Parts | |
join crp in db.CustomerReportParts on p.partID equals crp.partID | |
where p.dateModified >= start | |
orderby p.partID | |
select p).ToList<Part>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment