diff --git a/IProvider.cs b/IProvider.cs index 7ac2c8c..4fd89b5 100644 --- a/IProvider.cs +++ b/IProvider.cs @@ -12,38 +12,6 @@ namespace formula_manage /// public interface IProvider where T : class { - /// - /// 查询所有记录 - /// - /// - List Select(); - - /// - /// 查询一条记录 - /// - /// - /// - List Selectsql(T t); - - /// - /// 插入一条记录 - /// - /// - /// - int Insert(T t); - - /// - /// 修改一条记录 - /// - /// - /// - int Update(T t); - - /// - /// 删除一条记录 - /// - /// - /// - int Delete(T t); + } } diff --git a/MainWindow.xaml b/MainWindow.xaml index cc39a87..4102012 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -66,8 +66,8 @@ - - + + @@ -158,8 +158,8 @@ - + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 62c4d58..c22f2b2 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -105,7 +105,59 @@ namespace formula_manage } Grid_RRODUCT.ItemsSource = RRODUCTdataTable.DefaultView; + + this.DataContext = STUFFdataTable; + + + /* DataGridTemplateColumn tempColumn = Grid_RRODUCT.Columns[1] as DataGridTemplateColumn; + FrameworkElement element1 = Grid_RRODUCT.Columns[1].GetCellContent(Grid_RRODUCT.Items[1]); + System.Windows.Controls.ComboBox comboBox1 = tempColumn.CellTemplate.FindName("CP_PRODUCT_CODE", element1) as System.Windows.Controls.ComboBox; + + comboBox1.ItemsSource = STUFFdataTable.DefaultView;*/ + } + + + /* private int g_TypeNameDicNo; //枪型号名 + + public int G_TypeNameDicNo + { + get + { + return g_TypeNameDicNo; + } + set + { + g_TypeNameDicNo = value; + } } + public string G_TypeNameDicNoStr + { + get + { + return gunNameTypeDic[g_TypeNameDicNo]; //查找Dictionary返回它的Value + } + set + { + int selectedIndex = 0; + foreach (KeyValuePair pair in gunNameTypeDic) + { + if (pair.ToString().Equals(value)) //对比键值对 + { + selectedIndex = pair.Key; + } + } + G_TypeNameDicNo = selectedIndex; + } + } + + private Dictionary gunNameTypeDic; + public Dictionary GunNameTypeDic + { + get + { + return gunNameTypeDic; + } + }*/ private async void sql_() { diff --git a/ViewModel/RRODUCTViewModel.cs b/ViewModel/RRODUCTViewModel.cs index 67884db..85e5861 100644 --- a/ViewModel/RRODUCTViewModel.cs +++ b/ViewModel/RRODUCTViewModel.cs @@ -15,16 +15,6 @@ namespace formula_manage.ViewModel /// public class RRODUCTiewModel : ViewModelBase { - // private List products = new List(); - - /// - /// - /// - /* public List RRODUCT - { - - }*/ - /// /// StuffViewModeldl /// @@ -41,15 +31,8 @@ namespace formula_manage.ViewModel void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件 { - // if (Stuff.Button_sql == true)//获取按钮状态 - { - // if (Stuff.Buttontype_sql == -1) Product = new ProductProvider().Select(); - // if (Stuff.Buttontype_sql == 0) Product = new ProductProvider().Selects0(); - // if (Stuff.Buttontype_sql == 1) Product = new ProductProvider().Selects1(); - // if (Stuff.Buttontype_sql == 2) Product = new ProductProvider().Selects2(); - // if (Stuff.Buttontype_sql == 3) Product = new ProductProvider().Selects3(); - // Stuff.Button_sql = false;//清除按钮状态 - } + } + } }