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.
73 lines
2.1 KiB
73 lines
2.1 KiB
using SchedulingSystem.EntityClass; |
|
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> |
|
/// YSVIPWindow.xaml 的交互逻辑 |
|
/// </summary> |
|
public partial class XZYSVIPWindow : Window |
|
{ |
|
SurgerySchedulingEntities myModel = new SurgerySchedulingEntities(); |
|
public XZYSVIPWindow() |
|
{ |
|
InitializeComponent(); |
|
} |
|
|
|
private void btn_bc_Click(object sender, RoutedEventArgs e) |
|
{ |
|
if (ysxm.Text == null || ysxm.Text == string.Empty) |
|
{ |
|
MessageBox.Show("请填写患者名称"); |
|
return; |
|
} |
|
if (ysbm.Text == null || ysbm.Text == string.Empty) |
|
{ |
|
MessageBox.Show("请填写诊疗卡号"); |
|
return; |
|
} |
|
|
|
SYS_YSVIPB ysvip = new SYS_YSVIPB(); |
|
ysvip.YSXM = ysxm.Text; |
|
ysvip.YSBM = ysbm.Text; |
|
try |
|
{ |
|
myModel.SYS_YSVIPB.Add(ysvip); |
|
myModel.SaveChanges(); |
|
MessageBox.Show("新增成功"); |
|
this.Close(); |
|
} |
|
catch (Exception) |
|
{ |
|
MessageBox.Show("新增失败"); |
|
} |
|
} |
|
|
|
private void Window_Loaded(object sender, RoutedEventArgs e) |
|
{ |
|
//List<ComboBoxBinding> listysxm = new List<ComboBoxBinding>(); |
|
//listysxm = (from tbysb in myModel.SYS_YSB |
|
// select new ComboBoxBinding |
|
// { |
|
// ID = tbysb.ID, |
|
// Name = tbysb.YSXM, |
|
// }).ToList(); |
|
|
|
//ysxm.ItemsSource = listysxm; |
|
//ysxm.SelectedValuePath = "ID"; |
|
//ysxm.DisplayMemberPath = "Name"; |
|
} |
|
} |
|
}
|
|
|