82 lines
2.3 KiB
C#
82 lines
2.3 KiB
C#
using HandyControl.Controls;
|
|
using HandyControl.Data;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Diagnostics.Eventing.Reader;
|
|
using System.Linq;
|
|
using System.Media;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
using TouchSocket.Core;
|
|
using WCS.Model.ApiModel.MatInventoryDetail;
|
|
using 货架标准上位机.ViewModels;
|
|
|
|
namespace 货架标准上位机
|
|
{
|
|
public partial class OutInventoryAddMatView : HandyControl.Controls.Window
|
|
{
|
|
public OutInventoryAddMatViewModel viewModel = new OutInventoryAddMatViewModel();
|
|
|
|
public MatInventorySummaryModel inventorySummary = null;
|
|
|
|
public OutInventoryAddMatView()
|
|
{
|
|
InitializeComponent();
|
|
this.DataContext = viewModel;
|
|
}
|
|
|
|
private void closeClick(object sender, RoutedEventArgs e)
|
|
{
|
|
this.DialogResult = false;
|
|
this.Close();
|
|
}
|
|
|
|
private void comfirmClick(object sender, RoutedEventArgs e)
|
|
{
|
|
//
|
|
var item = viewModel.DataGridItemSource.Where(t => t.isSelected).FirstOrDefault();
|
|
if (item == null)
|
|
{
|
|
HandyControl.Controls.MessageBox.Show("请选择物料!");
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
//选中物料返回
|
|
inventorySummary = item;
|
|
this.DialogResult = true;
|
|
this.Close();
|
|
}
|
|
}
|
|
|
|
private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (viewModel.SelectedataGridItem != null)
|
|
{
|
|
viewModel.SelectedataGridItem.IsSelected = true;
|
|
//dataGrid.UnselectAllCells();//取消选中 避免手动点击check选项时反选失败 和重新点击该项时反选失败
|
|
}
|
|
|
|
}
|
|
catch
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
private void dataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
|
{
|
|
comfirmClick(sender, e);
|
|
}
|
|
}
|
|
|
|
}
|