Click here to Skip to main content
15,909,566 members
Home / Discussions / C#
   

C#

 
GeneralRe: Passing Generic List to other forms Pin
_Maxxx_14-Nov-11 18:15
professional_Maxxx_14-Nov-11 18:15 
GeneralRe: Passing Generic List to other forms Pin
BillWoodruff14-Nov-11 21:34
professionalBillWoodruff14-Nov-11 21:34 
GeneralRe: Passing Generic List to other forms Pin
Kendall Bodkin15-Nov-11 5:33
Kendall Bodkin15-Nov-11 5:33 
GeneralRe: Passing Generic List to other forms Pin
Pete O'Hanlon15-Nov-11 10:17
mvePete O'Hanlon15-Nov-11 10:17 
GeneralRe: Passing Generic List to other forms Pin
Kendall Bodkin15-Nov-11 10:24
Kendall Bodkin15-Nov-11 10:24 
QuestionNext Linq Question Pin
Kevin Marois14-Nov-11 12:44
professionalKevin Marois14-Nov-11 12:44 
AnswerRe: Next Linq Question Pin
BobJanova15-Nov-11 1:00
BobJanova15-Nov-11 1:00 
AnswerRe: Next Linq Question Pin
NeillJam17-Nov-11 22:50
NeillJam17-Nov-11 22:50 
Hi, probably not the best solution but off the top of my head i can think of 2 methods.

1. Use a switch on ProductID - case 0: --> do query to return all
default: --> do other query to return specifics matching ProductId


2.
List<< PartModel>>  results = ((ProductId != 0) ?  (from pp in context.mmlProductsParts
                                       join pa in context.tblParts on pp.PartId equals pa.PartId
                                       where pa.PartNumber.Contains(searchModel.SearchTerm) ||
                                               pa.Keyword.Contains(searchModel.SearchTerm)
                                               && pp.ProductId == ProductId
                                       select new PartModel
                                       {
                                           PartId = pa.PartId,
                                           Category = GetCategory(pa.CategoryId),
                                           PartNumber = pa.PartNumber,
                                           Keywords = pa.Keyword,
                                           PartDescription = pa.Description,
                                           Price = pa.Price.Value,
                                           Ratio = pa.Ratio.Value,
                                           Tribal = pa.Tribal
                                       }).ToList()
                                       : (from pp in context.mmlProductsParts
                                       join pa in context.tblParts on pp.PartId equals pa.PartId
                                       where pa.PartNumber.Contains(searchModel.SearchTerm) ||
                                               pa.Keyword.Contains(searchModel.SearchTerm)
                                        select new PartModel
                                        {
                                           PartId = pa.PartId,
                                           Category = GetCategory(pa.CategoryId),
                                           PartNumber = pa.PartNumber,
                                           Keywords = pa.Keyword,
                                           PartDescription = pa.Description,
                                           Price = pa.Price.Value,
                                           Ratio = pa.Ratio.Value,
                                           Tribal = pa.Tribal
                                       }).ToList()); 


Hope that helps
QuestionLinq To Objects - How To Create Nested Objects Pin
Kevin Marois14-Nov-11 12:18
professionalKevin Marois14-Nov-11 12:18 
AnswerRe: Linq To Objects - How To Create Nested Objects Pin
BillWoodruff14-Nov-11 21:52
professionalBillWoodruff14-Nov-11 21:52 
QuestionConvert XslTransform to XslCompiledTransform Pin
Melanie Peterson14-Nov-11 6:22
Melanie Peterson14-Nov-11 6:22 
QuestionUDP send /recieve problem... well mainly recieve Pin
Alberto Bar-Noy14-Nov-11 3:58
Alberto Bar-Noy14-Nov-11 3:58 
AnswerRe: UDP send /recieve problem... well mainly recieve Pin
Luc Pattyn14-Nov-11 4:45
sitebuilderLuc Pattyn14-Nov-11 4:45 
GeneralRe: UDP send /recieve problem... well mainly recieve Pin
Alberto Bar-Noy14-Nov-11 4:49
Alberto Bar-Noy14-Nov-11 4:49 
AnswerRe: UDP send /recieve problem... well mainly recieve Pin
Luc Pattyn14-Nov-11 5:14
sitebuilderLuc Pattyn14-Nov-11 5:14 
GeneralRe: UDP send /recieve problem... well mainly recieve Pin
Alberto Bar-Noy14-Nov-11 5:25
Alberto Bar-Noy14-Nov-11 5:25 
GeneralRe: UDP send /recieve problem... well mainly recieve Pin
Rob Philpott14-Nov-11 5:34
Rob Philpott14-Nov-11 5:34 
GeneralRe: UDP send /recieve problem... well mainly recieve Pin
Alberto Bar-Noy14-Nov-11 5:36
Alberto Bar-Noy14-Nov-11 5:36 
GeneralRe: UDP send /recieve problem... well mainly recieve Pin
Rob Philpott14-Nov-11 5:46
Rob Philpott14-Nov-11 5:46 
AnswerRe: UDP send /recieve problem... well mainly recieve Pin
Luc Pattyn14-Nov-11 5:35
sitebuilderLuc Pattyn14-Nov-11 5:35 
GeneralRe: UDP send /recieve problem... well mainly recieve Pin
Alberto Bar-Noy14-Nov-11 5:36
Alberto Bar-Noy14-Nov-11 5:36 
AnswerRe: UDP send /recieve problem... well mainly recieve Pin
Alberto Bar-Noy14-Nov-11 5:40
Alberto Bar-Noy14-Nov-11 5:40 
Questiondistribute stored procedure files Pin
Marcel Vreuls (www.agentbase.nl)14-Nov-11 2:30
Marcel Vreuls (www.agentbase.nl)14-Nov-11 2:30 
AnswerRe: distribute stored procedure files Pin
SilimSayo14-Nov-11 10:42
SilimSayo14-Nov-11 10:42 
QuestionMouse move (hover) over an Image with Graphics drawings Pin
eyalbi00714-Nov-11 2:12
eyalbi00714-Nov-11 2:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.