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

62 lines
1.7 KiB

using SchedulingSystemClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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;
namespace SchedulingSystem
{
/// <summary>
/// XZHZVIPWindow.xaml 的交互逻辑
/// </summary>
public partial class XZHZVIPWindow : Window
{
SurgerySchedulingEntities myModel = new SurgerySchedulingEntities();
public XZHZVIPWindow()
{
InitializeComponent();
}
private void btn_bc_Click(object sender, RoutedEventArgs e)
{
if (hzxm.Text == null || hzxm.Text == string.Empty)
{
MessageBox.Show("请填写患者名称");
return;
}
if (zlkh.Text == null || zlkh.Text == string.Empty)
{
MessageBox.Show("请填写诊疗卡号");
return;
}
if (zyh.Text == null || zyh.Text == string.Empty)
{
MessageBox.Show("请填写住院号");
return;
}
SYS_HZVIPB hzvip = new SYS_HZVIPB();
hzvip.HZXM = hzxm.Text;
hzvip.ZLKH = zlkh.Text;
try
{
myModel.SYS_HZVIPB.Add(hzvip);
myModel.SaveChanges();
MessageBox.Show("新增成功");
this.Close();
}
catch (Exception)
{
MessageBox.Show("新增失败");
}
}
}
}