Click here to Skip to main content
15,867,453 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Pew_new23-Aug-18 8:52
Pew_new23-Aug-18 8:52 
GeneralRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Richard Deeming23-Aug-18 9:05
mveRichard Deeming23-Aug-18 9:05 
GeneralRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Pew_new24-Aug-18 3:09
Pew_new24-Aug-18 3:09 
GeneralRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Gerry Schmitz24-Aug-18 6:08
mveGerry Schmitz24-Aug-18 6:08 
GeneralRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Pew_new25-Aug-18 7:36
Pew_new25-Aug-18 7:36 
QuestionScale items with ViewBox within an ItemsControl Pin
Kenneth Haugland7-Aug-18 6:07
mvaKenneth Haugland7-Aug-18 6:07 
AnswerRe: Scale items with ViewBox within an ItemsControl Pin
Kenneth Haugland8-Aug-18 3:56
mvaKenneth Haugland8-Aug-18 3:56 
QuestionPredicateBuilder Question Pin
Kevin Marois14-Jul-18 18:21
professionalKevin Marois14-Jul-18 18:21 
I'm querying 3 tables with Joins:
// List for returning results
List<PurchasingEntity> results = null;

// Query of all joined records 
IQueryable<PurchasingEntity> query = (from c in db.Companies
                                        join p in db.Projects on c.Id equals p.CompanyId
                                        join j in db.Jobs on p.Id equals j.ProjectId
                                        select new PurchasingEntity
                                        {
                                            CompanyId = c.Id,
                                            CompanyName = c.CompanyName,
                                            ProjectId = p.Id,
                                            ProjectName = p.ProjectName,
                                            ProjectStatusId = p.StatusId.HasValue ? p.StatusId : 0,
                                            JobId = j.Id,
                                            JobNumber = j.JobId,
                                            Phase = j.Phase,
                                            Quantity = j.Quantity.HasValue ? j.Quantity.Value : 0,
                                            StartDate = j.StartDate.HasValue ? j.StartDate : null,
                                            LumberVendorId = j.LumberVendorId,
                                            HardwareVendorId = j.HardwareVendorId,
                                            TrussVendorId = j.TrussVendorId
                                        });

// Create the PredicateBuilder
var predicate = PredicateBuilder.True<PurchasingEntity>();

// Add status Awarded filter
predicate = predicate.And(i => i.ProjectStatusId == awardedId);

// Add optional query parameters
if (companyId > 0)
{
    predicate = predicate.And(i => i.CompanyId == companyId);
}

if (projectId > 0)
{
    predicate = predicate.And(i => i.ProjectId == projectId);
}

if (startDate != null)
{
    predicate = predicate.And(i => i.StartDate >= startDate);
}

if (endDate != null)
{
    predicate = predicate.And(i => i.StartDate <= endDate);
}

// Set the query's WHERE clause to the predicate and call ToList
results = query.Where(predicate).ToList();

I doh't want to include an Companies, Projects, or Jobs if they are marked as deleted, which is DeletedDT.HasValue.

The problem is that the PredicateBuilder is working on type PurchasingEntity which is being formed via the join.

How do I filter these out???
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: PredicateBuilder Question Pin
Richard Deeming16-Jul-18 8:19
mveRichard Deeming16-Jul-18 8:19 
AnswerRe: PredicateBuilder Question Pin
Gerry Schmitz16-Jul-18 10:15
mveGerry Schmitz16-Jul-18 10:15 
QuestionWPF HyperLink Binding To MainWindowViewMOdel Not Working Pin
Kevin Marois9-Jul-18 17:02
professionalKevin Marois9-Jul-18 17:02 
AnswerRe: WPF HyperLink Binding To MainWindowViewMOdel Not Working Pin
Pete O'Hanlon9-Jul-18 20:07
subeditorPete O'Hanlon9-Jul-18 20:07 
GeneralRe: WPF HyperLink Binding To MainWindowViewMOdel Not Working Pin
Kevin Marois10-Jul-18 6:53
professionalKevin Marois10-Jul-18 6:53 
QuestionBind TabItem ContexMenu Command To Window VM Pin
Kevin Marois8-Jul-18 12:03
professionalKevin Marois8-Jul-18 12:03 
AnswerRe: Bind TabItem ContexMenu Command To Window VM Pin
Richard Deeming9-Jul-18 8:35
mveRichard Deeming9-Jul-18 8:35 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Kevin Marois9-Jul-18 16:23
professionalKevin Marois9-Jul-18 16:23 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Pete O'Hanlon10-Jul-18 7:08
subeditorPete O'Hanlon10-Jul-18 7:08 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Kevin Marois10-Jul-18 7:38
professionalKevin Marois10-Jul-18 7:38 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Pete O'Hanlon10-Jul-18 10:40
subeditorPete O'Hanlon10-Jul-18 10:40 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Kevin Marois10-Jul-18 11:21
professionalKevin Marois10-Jul-18 11:21 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Kevin Marois15-Jul-18 16:08
professionalKevin Marois15-Jul-18 16:08 
AnswerRe: Bind TabItem ContexMenu Command To Window VM Pin
NaBian18-Sep-18 5:11
NaBian18-Sep-18 5:11 
QuestionListBox of Hyperlinks - Selected Item Pin
Kevin Marois6-Jul-18 19:37
professionalKevin Marois6-Jul-18 19:37 
AnswerRe: ListBox of Hyperlinks - Selected Item Pin
Mycroft Holmes7-Jul-18 13:38
professionalMycroft Holmes7-Jul-18 13:38 
AnswerRe: ListBox of Hyperlinks - Selected Item Pin
Richard Deeming9-Jul-18 8:32
mveRichard Deeming9-Jul-18 8:32 

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.