diff --git a/Models/DyelotsBulkedRecipeProvider.cs b/Models/DyelotsBulkedRecipeProvider.cs index 94fdff8..0beca18 100644 --- a/Models/DyelotsBulkedRecipeProvider.cs +++ b/Models/DyelotsBulkedRecipeProvider.cs @@ -12,7 +12,12 @@ namespace Models public int Delete(DyelotsBulkedRecipe t) { - throw new NotImplementedException(); + if (t == null) return 0; + var model = db.DyelotsBulkedRecipe.ToList().FirstOrDefault(item => t.Dyelot == item.Dyelot); + if (model == null) return 0; + db.DyelotsBulkedRecipe.Remove(model); + int count = db.SaveChanges(); + return count; } public int Insert(DyelotsBulkedRecipe t) @@ -22,7 +27,7 @@ namespace Models public List Select() { - throw new NotImplementedException(); + return db.DyelotsBulkedRecipe.SqlQuery("select TOP (10000) * from DyelotsBulkedRecipe").ToList();//查询前100条 } public int Update(DyelotsBulkedRecipe t) diff --git a/View/QueryView.xaml b/View/QueryView.xaml index f04837f..ab35f46 100644 --- a/View/QueryView.xaml +++ b/View/QueryView.xaml @@ -15,7 +15,7 @@ - + - - - - + + + + - + - - - - - - - + + + + + + + diff --git a/View/QueryView.xaml.cs b/View/QueryView.xaml.cs index c507f21..5a6511d 100644 --- a/View/QueryView.xaml.cs +++ b/View/QueryView.xaml.cs @@ -66,15 +66,6 @@ namespace Audit.View } } - private void DataGrid_Detailed(object sender, SelectionChangedEventArgs e) - { - - } - - private void DataGrid_Directory(object sender, SelectionChangedEventArgs e) - { - - } private void DataGridDyelot_MouseDoubleClick(object sender, MouseButtonEventArgs e)// DataGridDyelot表格双击事件 { int rownum = this.DataGridDyelots.SelectedIndex;//获取鼠标选中行并定义变量 diff --git a/ViewModel/QueryViewModel.cs b/ViewModel/QueryViewModel.cs index 5f05b5e..2f889a1 100644 --- a/ViewModel/QueryViewModel.cs +++ b/ViewModel/QueryViewModel.cs @@ -15,6 +15,7 @@ namespace Audit.ViewModel public class QueryViewModel : ViewModelBase { private List dyelots = new List(); + private List dyelotsBulkedRecipe = new List(); /// /// 所有工单 /// @@ -30,12 +31,25 @@ namespace Audit.ViewModel RaisePropertyChanged(); } } + public List DyelotsBulkedRecipe + { + get + { + return dyelotsBulkedRecipe; + } + set + { + dyelotsBulkedRecipe = value; + RaisePropertyChanged(); + } + } /// /// /// public QueryViewModel() { dyelots = new DyelotsProvider().Select(); + dyelotsBulkedRecipe = new DyelotsBulkedRecipeProvider().Select(); } }