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.
90 lines
2.7 KiB
90 lines
2.7 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> |
|
/// XZGZSSLXWindow.xaml 的交互逻辑 |
|
/// </summary> |
|
public partial class XZGZSSLXWindow : Window |
|
{ |
|
public XZGZSSLXWindow() |
|
{ |
|
InitializeComponent(); |
|
} |
|
SurgerySchedulingEntities myModel = new SurgerySchedulingEntities(); |
|
private void Window_Loaded(object sender, RoutedEventArgs e) |
|
{ |
|
List<ComboBoxBinding> listsslx = new List<ComboBoxBinding>(); |
|
listsslx = (from tbsss in myModel.SYS_SSQKLXB |
|
select new ComboBoxBinding |
|
{ |
|
ID = tbsss.ID, |
|
Name = tbsss.QKLX, |
|
}).ToList(); |
|
sslx.ItemsSource = listsslx; |
|
sslx.SelectedValuePath = "ID"; |
|
sslx.DisplayMemberPath = "Name"; |
|
} |
|
|
|
private void btn_bc_Click(object sender, RoutedEventArgs e) |
|
{ |
|
int intqz; |
|
if (sslx.SelectedItem == null) |
|
{ |
|
MessageBox.Show("请选择手术类型"); |
|
return; |
|
} |
|
try |
|
{ |
|
intqz = Convert.ToInt32(qz.Text); |
|
} |
|
catch (Exception) |
|
{ |
|
MessageBox.Show("请输入正确的权重格式"); |
|
return; |
|
} |
|
int lxid = Convert.ToInt32(sslx.SelectedValue); |
|
var listsslx = (from tbsslx in myModel.SYS_SSQKLXB |
|
where tbsslx.ID == lxid |
|
select new |
|
{ |
|
tbsslx |
|
}).ToList(); |
|
//if (listsslx.Count>0) |
|
//{ |
|
// MessageBox.Show("不能重复设置"); |
|
// return; |
|
//} |
|
|
|
|
|
//Bus_SSLXQZB sslxqz = new Bus_SSLXQZB(); |
|
//sslxqz.SSLXID = lxid; |
|
//sslxqz.SSLX = sslx.Text.ToString(); |
|
//sslxqz.QZ = intqz; |
|
//try |
|
//{ |
|
// myModel.Bus_SSLXQZB.Add(sslxqz); |
|
// myModel.SaveChanges(); |
|
// MessageBox.Show("新增成功"); |
|
// this.Close(); |
|
//} |
|
//catch (Exception) |
|
//{ |
|
// MessageBox.Show("新增失败"); |
|
//} |
|
} |
|
} |
|
}
|
|
|