WPF Datagrid SelectionChanged事件和实体框架
在WPF应用程序中,我有一个datagrid,其中包含来自实体框架请求的数据 方法:WPF Datagrid SelectionChanged事件和实体框架,wpf,entity-framework,Wpf,Entity Framework,在WPF应用程序中,我有一个datagrid,其中包含来自实体框架请求的数据 方法: public static void GetArticlesDisposCommandes(DataGrid dt,string artCodeForms,string artCodeERP) { using (GSUITEEntities dc = new GSUITEEntities()) { dt.ItemsSource = (from a in dc.GCSTOCK
public static void GetArticlesDisposCommandes(DataGrid dt,string artCodeForms,string artCodeERP)
{
using (GSUITEEntities dc = new GSUITEEntities())
{
dt.ItemsSource = (from a in dc.GCSTOCK
join b in dc.FICHES_ARTICLES on a.STO_COD_ART equals b.ART_CODE
where (b.ART_CODE == artCodeForms || b.ART_CODE == artCodeERP)
&& !a.STO_NUMPAL.StartsWith("FDR")
&& a.STO_PICKING != null
&& a.STO_OUTDATE == null
&& a.STO_PRECO == 0
select new
{
a.STO_ID,
b.ART_CODE,
b.ART_LIBELLE1,
a.STO_NUMPAL,
a.STO_PICKING,
a.STO_PNET,
a.STO_DATECONG,
a.STO_DLUO,
a.LOT_ID,
a.STO_LOT1
}).ToList();
}
}
xaml标记: