You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using XGL.Data.DBService;
using XGL.Models.Model.FoamingMac;
namespace XGLFinishPro.Views
{
/// <summary>
/// ShouPeiWin.xaml 的交互逻辑
/// </summary>
public partial class ShouPeiWin : Window
{
FormingMachineService formingMachineService = new FormingMachineService();
FoamingMacModel _foamingMacModel;
public ShouPeiWin()
{
InitializeComponent();
}
public ShouPeiWin(FoamingMacModel foamingMac)
{
InitializeComponent();
_foamingMacModel = foamingMac;
}
private void btnOK_Click(object sender, RoutedEventArgs e)
{
this.lbMsg.Content = "";
if (string.IsNullOrEmpty(this.txtBarcode.Text))
{
this.lbMsg.Content = "条码号不能为空!";
return;
}
else if (formingMachineService.InsertData(_foamingMacModel))
{
//this.Close();
}
else
{
this.lbMsg.Content = "完成失败!";
}
}
private void btnCancel_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void txtBarcode_TextChanged(object sender, TextChangedEventArgs e)
{
this.lbMsg.Content = "";
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if (this.DialogResult == false)
{
e.Cancel = true;
}
}
}
}