Click here to Skip to main content
15,922,427 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
var notice = (from n in context.Notice
                              join nd in context.NoticeDetail
                              on n.ID equals nd.NoticeID
                              where nd.SenderLocationID == locationID && nd.SenderActionID == sent && nd.Title !=""
                              select new
                                 {
                                     NoticeID = nd.NoticeID,
                                     NoticeDetailID = nd.ID,
                                     From = (currentLanguage == enmLanguage.English) ? nd.SenderPanchayatiRajLocation.Name : nd.SenderPanchayatiRajLocation.NameRegional,
                                     Subject = nd.Title,
                                     Date = nd.CreatedOn,
                                     Priority = (currentLanguage == enmLanguage.English) ? n.Priority.Name : n.Priority.Name_Regional,
                                     SentMail = context.NoticeRecipients.Where(a => a.NoticeDetailID == nd.ID).Count(),
                                     Replies = context.NoticeRecipients.Where(a => a.ReceiverLocationID == locationID && (a.ReceiverActionID == received || a.ReceiverActionID == read) && a.NoticeDetail.NoticeID == nd.NoticeID).Count()
                                 
                                 }).Distinct();
               
                notice = notice.OrderBy(s => s.Priority).ThenBy(s => s.Date);
                PagingBar1.Bind(notice, ref gvReceive);
Posted
Updated 10-May-14 1:34am
v3
Comments
Maciej Los 10-May-14 7:18am    
Sorry, but we can't read in your mind or direct from your screen...
You need to provide more details about your issue!
Neha Mukesh 10-May-14 7:36am    
i want to group these values on the basisi of notice
ID ...I have two table one is notice and other is noticedetail whenever i save my record first it saves in notice and then notice detail but when i have a key i only saves data in notice detail

1 solution

Sorry, but not clear what you are asking?
var gitms = notice.GroupBy(g => g.NoticeID);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900