private void BtnEdit_Click(object sender, RoutedEventArgs e)
 {
     if (DGMain.SelectedItem == null)
     {
         MessageBox.Show("请先选中一条数据!");
     }
     else
     {
         EquipmentType             temp = (EquipmentType)DGMain.SelectedItem;
         WinEquipmentTypeAddOrEdit win  = new WinEquipmentTypeAddOrEdit(temp.Id);
         win.ShowDialog();
         Query();
     }
 }
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            WinEquipmentTypeAddOrEdit win = new WinEquipmentTypeAddOrEdit(null);

            win.ShowDialog();
        }